Updating Date Field in Access Through ASP

Results 1 to 3 of 3

Thread: Updating Date Field in Access Through ASP

  1. #1
    Join Date
    Dec 1969
    Posts
    78

    Default Updating Date Field in Access Through ASP

    I am trying to create a page where users can update their records in the database. I also want to record the date into the database. Everything I&#039ve tried has not worked. Their name gets updated but the date does not take.<BR><BR>Any suggestions?<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: Updating Date Field in Access Through ASP

    You use a SQL statement like so that should do it, don&#039t forget the # before and after the date value in the SQL string. That should do it or have you tried this already?<BR><BR>MySQL = "UPDATE UsersTable SET Name = &#039" & MyNameVar & "&#039, THEDATE = #" & Date & "#"<BR><BR>Pete

  3. #3
    Lakshminarayan K Guest

    Default RE: Updating Date Field in Access Through ASP

    Do a IsDate check before using the SQL. The IsDate(&#060;date>) function tells you if the data is valid date or not. The do a CDate on the data. This will convert into the format necessary for the database to recognize it as a date. <BR>Then use the SQL -<BR><BR>"UPDATE UsersTable SET Name = &#039" & MyNameVar & "&#039, THEDATE = &#039" & &#060;date> & "&#039"<BR><BR>Hope this helps...<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
  •