General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only