Home > SQL Development > Updating Dates in Access 2000

Updating Dates in Access 2000



<i><b>Originally posted by : Paul (gridiron@tcny.rr.com)</b></i><br />I have spent the last 1/2 day trying to get a date updated in an Access 2000 table via ASP and<br />SQL.<br /><br />If I takeout the following code the update works: (if I don't, I get a SQL syntax error)<br /><br />sSQL = sSQL & "date = #" & newdate & "#,"<br />.... (more sSQL statements)<br /><br /><br />The date field in Access is a short date in the format 00/00/00<br />I perform a Response.write (newdate) before the SQL stuff and it comes out correct - 04/06/00<br /><br />Can someone give me a clue what's going on? I have tried just using the date, changing the #'s <br />to ' - all with the same results. All I really want to do here is to update the date currently in the table <br />with the current date.

    
Guest


<i><b>Originally posted by : Mike B (mikeb811@hotmail.com)</b></i><br />I believe the problem is in your SQL statement. You use " date = " in your SQL string and date is a reserved keyword. Try changing that and the database field name to something else like somedate and see how that works.<br /><br />Hope this helps<br /><br />Mike<br /><br /><br />------------<br />Paul at 4/6/2000 5:38:15 PM<br /><br />I have spent the last 1/2 day trying to get a date updated in an Access 2000 table via ASP and<br />SQL.<br /><br />If I takeout the following code the update works: (if I don't, I get a SQL syntax error)<br /><br />sSQL = sSQL & "date = #" & newdate & "#,"<br />.... (more sSQL statements)<br /><br /><br />The date field in Access is a short date in the format 00/00/00<br />I perform a Response.write (newdate) before the SQL stuff and it comes out correct - 04/06/00<br /><br />Can someone give me a clue what's going on? I have tried just using the date, changing the #'s <br />to ' - all with the same results. All I really want to do here is to update the date currently in the table <br />with the current date.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved