Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Update syntax for DateTime field
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00486828
Message ID:
00486968
Views:
10
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
Map
View

Click here to load this message in the networking platform