Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL INSERT
Message
 
To
22/03/2000 09:38:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00348848
Message ID:
00348856
Views:
16
Edgar,

>Well, today I seem to have problems inserting a date variable
>Here is an example:

>fyr =cursor.fyr $&& string
>ldDate = cursor.Sdate && datetime data type

>cSQL="INSERT INTO Transbud (fyr, Sdate )"
>cSQL=cSQL + " VALUES ('"+lcfyr+"',"+ALLT(STR(ldDate))+")"

>what am I missing here?

ldDate is a date, therefore STR(ldDate) would cause an error. If you want just the date portion try
cSQL=cSQL + " VALUES ('"+lcfyr+"',"+DTOC(TTOD(ldDate))+")"

Of course VFP6 and strict date compliance won't like the DTOC() function, but you get the idea?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform