Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with this statement in SQLEXEC( ) ?
Message
From
24/09/2005 15:32:43
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01052565
Message ID:
01052778
Views:
8
>>>While you have your answer, the real problem is that SQL Server 2000 always uses ANSI settings for things like datetimes. So
csql = "select * from prestacoes where data_venc <= '2/28/2006 00:00:00'"
should also work. The time portion of the above is optional.
>>
>>Now you're getting me confused. Isn't ANSI the yyyy-mm-dd date, and American date mm-dd-yyyy? That's when you get in VFP when you Set Date ANSI/American.
>
>Geez, Dragan, I don't know. And I can't find where I read that. All I can say is that I don't have any problems with any of our SQL Servers when I use "mm/dd/yyyy" or add the time to it.

My routine to convert any value to something that can be inserted into a SQL command (I do all my SQL server stuff via SPT) returns '2005-09-24 15:29:40' for a datetime value and I never had a problem with that. The relevant lines of code:
#define C_SQUOTE [']
cRetVal=C_SQUOTE+transform(ttoc(tuvalue,1), "@R 9999-99-99 99:99:99")+C_SQUOTE
And I've used it on about six databases on three servers (in three states :). I think, but can't be sure, that all the relevant settings on these servers were left at default - which means my date delimiters, ANSI quotes etc are untouched.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform