Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
No easy way to get Date portion of DateTime field - Right?
Message
From
06/07/2001 11:20:38
Dan Denne
Caroselli Beachler McTiernan & Conboy
Pittsburgh, Pennsylvania, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
No easy way to get Date portion of DateTime field - Right?
Miscellaneous
Thread ID:
00527483
Message ID:
00527483
Views:
46
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?
Next
Reply
Map
View

Click here to load this message in the networking platform