Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No easy way to get Date portion of DateTime field - Righ
Message
From
06/07/2001 11:38:37
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/07/2001 11:20:38
Dan Denne
Caroselli Beachler McTiernan & Conboy
Pittsburgh, Pennsylvania, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00527483
Message ID:
00527496
Views:
14
>I'm new to VFP/SQL6.5 and wanted to be sure I've got this right. I've seen several messages about using CAST/CONVERT to extract the date from an SQL DateTime field using SQLExec(), but find it hard to believe it's not easier.
>
>I have a table with DateTime fields. I would like to use both the Date and Time portions, sometimes independantly, sometimes together for calculating differences. I want to create a SELECT statement that returns all records in the table for a given date(regardless of time). Is the CAST/CONVERT method the easiest way to do this?
>
>Since I'm just getting started, would it be easier to store the DATE and TIME in the SQL table as characters and use ctot() and ctod() to work with them in VFP once I have them in a cursor? If so, what reason is there to use the DateTime field in SQL?

Perhaps you can use the VFP function: ttod().

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform