Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: AS/400 Date Not Valid

    Hi,

    I'm developing a program using VB6 and I need to update records in AS/400 database. I need to update current date into a timestamp data type field (PRCDATE) in AS/400 file.

    strSQL = "UPDATE myAS400Library.myAS400File SET PRCDATE = '" & Now & "' WHERE " DISTCODE = '" & rs!DISTCODE & "' "

    cn.Execute strSQL

    I'll receive error message "..Syntax of date, time or timestamp value not valid.."

    I also tried to hardcode the value of PRCDATE as '2004-12-17 11:10:03.740424' but the same error occurs.

    Need help with this..

  2. #2
    Join Date
    May 2004
    Posts
    97
    Try sending the date format of YYYYMMDD or MMDDYYYY

  3. #3
    Join Date
    Mar 2004
    Location
    Oakland, CA, USA
    Posts
    26
    Hello kiwy_77,

    Try to enclose your date with "#":

    strSQL = "UPDATE myAS400Library.myAS400File SET PRCDATE = #" & Now & "# WHERE " DISTCODE = '" & rs!DISTCODE & "' "

Posting Permissions

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