Problem with updating the date

Results 1 to 2 of 2

Thread: Problem with updating the date

  1. #1
    Takeshi.T Guest

    Default Problem with updating the date

    Hi all.<BR><BR>I am having a problem with updating the date on the Access 2000 DB. I have a field called UpdateDate on the DB and try to put a Date value from asp page. On the DB, the field type is Date/time.<BR><BR>what I did was<BR><BR>UpdateDate = DateValue(Now)+TimeValue(Now)<BR>and<BR>SQL="updat e UpdateDate=" & UpdateDate & " Where ForumID=..."<BR><BR>this code gives me an error that says<BR><BR>"A literal value in the command could not be converted to the <BR>correct type due to a reason other than data overflow."<BR><BR>At first, I thought "DateValue(Now)+TimeValue(Now)" statement<BR>was wrong, but somehow it works to insert new records using<BR>this. <BR><BR><BR>I also read many threads about this and tried them, but didn&#039;t work. I tried to put single quote around "UpdateDate", tried to<BR>put # sign around it, tried to change the data field and so on...<BR><BR>I don&#039;t know what to do now.... I&#039;m stuck...<BR>Please give me a suggestion. <BR><BR>Thank you.<BR><BR>Takeshi

  2. #2
    Join Date
    Dec 1969

    Default ASPFAQs, category Databases, Errors

    The link to the ASPFAQs is at the top right of this page.<BR><BR>Short answer: Access, and Access *ONLY*, uses #...# around literal date values. Every other database uses &#039;...&#039;. No database allows a date literal with nothing surrounding it.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts