VB Insert SQL with Time Format Field

G

Guest

HELP :(

tblTime
TimeID (Key)
TimeSlot (Time)

I have a VB Module to insert TimeSlots. As a test I did the following:
tmpTimeID = 2
tmpTimeSlot = 1010 (defind as Integer)

SQL Statement is:
SQL1="INSERT INTO tblTime (TimeID, TimeSlot) VALUES (' " & tmpTimeID & " ' ,
' " & tmpTimeSlot & " ' ) "

It creates the record with the key of 2, but for TimeSlot field is EMPTY!
I tried chaning the tmpTimeSlot to String (instead of Integer) and still
nothing....

Anyone? Help... Please....
 
A

Alex Dybenko

Hi,
if you TimeSlot has date/time type - then you can insert correct value in
following format: #mm/dd/yyyy hh:hh#
 
G

Guest

Sorry for the tripple post... seemed like it did not post it so I tried
again...

Anyway, I found the solution in the meantime :)

(have to be string HH:SS) - so it is working....

Blessings to all...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top