Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SmallDateTime in MSSQL to Date in VFP
Message
 
 
To
24/10/2003 10:41:32
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00841887
Message ID:
00842128
Views:
25
>>>
-- sql server t-sql code
>>>select convert(smalldatetime, convert(varchar, date_col, 101)) as date_col...
>>>and then deal with date display/calculations in the VFP code, e.g., if you have to calculate date difference between dates, etc. Of course, if you need that kind of calculation, you could also let SQL Server handle that, as well.
>>
>>I am not familiar with the function convert() so I will have to look it up. It must be a SQL Server function as I don't see it in the VFP 8 help.
>>
>>Thank you for your help.
>
>yep it's a T-SQL function, i should've been clearer
>e.g.
>
** vfp code
>SQLEXEC(lnHandle, "select convert(smalldatetime, convert(varchar, date_col, 101)) as date_col, etc...")
But I already changed my mind <g>. I decided not to convert the datatime to date because instead of being able to do "Select *" I would have to now specify each field/column. I thought it would be better (easier <g>) if I just deal with the DateTime type field on the VFP side. Basically, using function ttod() I can manipulate the value and show only the Date portion of it.

Thank you for your help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform