If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > vbscript & sql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-14-04, 23:09
softie() softie() is offline
Registered User
 
Join Date: Sep 2004
Posts: 21
Unhappy 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.
Reply With Quote
  #2 (permalink)  
Old 09-15-04, 02:13
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 09-15-04, 21:55
softie() softie() is offline
Registered User
 
Join Date: Sep 2004
Posts: 21
i figured it out stupid mistake

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

should be

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

argh
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On