Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Update syntax for DateTime field
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00486828
Message ID:
00486968
Vues:
9
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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform