I believe u need quotes around the date (if using SQL).
The following works in a VFP-to-SQL environment:
mCommand = "UPDATE reports SET REPORTNAME='"+m.reportname+"',reportdate='"+DTOC(m.reportdate)+"' WHERE reportid='"+m.reportid+"'"
Which builds a string (mCommand) that looks like:
UPDATE reports
SET reportname='Reportname 1',reportdate = '12/15/2001'
WHERE reportid = 'A100'
>hi there! can anyone help me?
>
>can anyone show me how to use the sql update syntax for DateTime field?
>
>i have tried using this code in my SQL statement:
>mydate=now()
>sqlupdate = "UPDATE questions SET question = '"& request("question") &"', answer = '"& request("answer") &"', date = {"& mydate &"} WHERE id = " & myid
>
>and i keep on getting this error:
>Microsoft OLE DB Provider for SQL Server error '80040e14'
>Syntax error or access violation
>
>if anyone can help me i would be very thankful!
>
>thanks in advance!
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