Results 1 to 3 of 3

Thread: vbscript & sql

  1. #1
    Join Date
    Sep 2004
    Posts
    21

    Unhappy Unanswered: vbscript & sql

    hi. i'm creating an asp page using vbscript. i create and execute a string as an SQL statement.

    problem:

    strSQL = ..... " ' " & Date() & " ' " .......... <-- this works
    strSQL = ..... " ' " & Time() & " ' " .......... <-- this does not

    i get a string conversion error. i'm storing the time as the data type TIME in my SQL table.

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    What type of DB do you have? This probably has nothing to do with the issue, but you don't need spaces before and after your date or time value:

    strSQL = ..... " '" & Date() & "' " ..........
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Sep 2004
    Posts
    21
    i figured it out stupid mistake

    strSQL = ..... " ' " & Time() & " ' " ..........

    should be

    strSQL = ..... " ' " & FormatDateTime(Time(), vbShortTime) & " ' " ..........

    argh

Posting Permissions

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