Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Syntax for dates
Message
From
22/08/2006 15:01:22
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01147655
Message ID:
01147671
Views:
21
Thanks Sergey,

it turns out that my initial error was due to me passing the date in DMY format. I have switched to using the SPT parameter and that works great.

Thanks.

>The date literals can either be represented as strings or numbers. See BOL for details.
>The 22/08/2006 is 22 devided by 8 and devided by 2006 which is equals 0. 0 is base SQL date = 01/01/1900. Try
WHERE edc_dentry = '2006-08-22'
You can also use SPT parameters
>
 ldDate = DATE(2006,08,22)
>...
>WHERE edc_dentry = ?ldDate
>
>
>
>>Thanks, initially I had the single quotes around the date time, but got an error about problems converting the character value (or something like that).
>>
>>I have since found that if I just put:
>>
>>
>>WHERE edc_dentry = 22/08/2006
>>
>>
>>I at least get some data (even though the edc_dentry field has a value of 01/01/1900 in it!
>>
>>Is there some better way of passing a date value to SQL Server that won't have the problem of whether using DMY or MDY or YMD format dates?
>>
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform