Link to home
Start Free TrialLog in
Avatar of mandydion
mandydion

asked on

urgent: vb, convert a string to time format

hi all,

currently i have a string, for example: "20:18:54" , is it a way to convert it into time format/type, so that i can use/insert it into a database where the field is time format. how to write it in vb code? thanks!


mandy
ASKER CERTIFIED SOLUTION
Avatar of mladenovicz
mladenovicz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of morchuboo
morchuboo

I struggled with the same problem for awhile - its due to the differing ways different microsoft produts handle dates/time
You dont need to convert the string at all - you just need to put in the sql statement correctly:

strsql = "INSERT INTO <table> (<name of field to contain the time>) VALUES ( #" & <variable containing time string> & "#)

Hope it helps