Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with SQL Update for Date and DateTime Formats
Message
From
16/01/2003 10:28:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/01/2003 09:38:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00742352
Message ID:
00742395
Views:
19
>Hi
>
>I am developing a data object which I am using to perform data operations on a SQL Database. I am working on a new method of the object which is intended to be a SQL Update command, and I am passing three parameters
>
>1) SQL Table to be Updated
>2) Primary Key (Identiying Row of Table)
>3) A 2 dimensional array of Fields and Values to update.
>
>dime arr(2,2)
>arr(1,1)="name"
>arr(1,2)="John Smith"
>arr(2,1)="date_entered"
>arr(2,2)=date()
>
>I am having problems knowing how to construct the UPDATE SQL command, to handle DATE and DATETIME types.
>
>eg.
>lcCmd="update batch_log set process_date = {" + dtoc(date()-1) + "} where batch_id=1"
>
>then passing this command to SQLEXEC(nHandle,lcCmd) always fails!
>
>Can anyone help with how I pre-prepare date and date time types in the string passed to SQLEXEC?
>
>Many thanks
>Wayne Trueman

luDateOrDateTime = {^2002/1/1 12:58}
lcCmd="update batch_log set process_date = ?luDateOrDateTime"+;
" where batch_id=1"

Cetin
Ç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