Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC - INSERT INTO syntax question
Message
From
01/01/2002 06:44:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00599449
Message ID:
00599558
Views:
27
Allan,
As Larry said it's not and if AutoTranslate is not in effect insertions are likely to fail. To be sure pass them in ODBC canonical format - YYYY/MM/DD hh:mm:ss. It's how SQL server expects via ODBC (convert() function's style 102)

For date(), datetime(), month(), day() etc you could use SQL server's Getdate(), datepart() etc functions.
Cetin

>Thanks Sergey. I didn't think it would be that simple.
>
>>>Now, I want to do the same thing with datetime and numeric fields. How would I handle inserting records with those data types using SQLEXEC?
>>The datetime value in SQL Server is represented by a character string.
...
>>strSQL = strSQL + Transform(lnNumber) + ", "
>>strSQL = strSQL + "'" + DTOC(ldDate) + "', "
>>strSQL = strSQL + "'" + TTOC(ltDatetime) + "', "
>>...
>>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform