Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CStr Function

Status
Not open for further replies.

pamo

Technical User
Oct 28, 2002
17
0
0
GB
I have a table which has imported data thru the use of a vbscript. I have a time field for logon_time and logoff_time. The problem is that a time for eg: 07:09:50 being 7am 9 min and 50 sec is being truncated to 7:9:50. so all leading zeros are removed. I HAVE BEEN TOLD THAT CStr function will resolve this but i am not sure how

please help

 
I'd use Format() - it's covered in VBHelp.

If your data is in the form of a date eg 7:9:50

Then Format(yourdate,"hh:nn:ss") will produce
07:09:50


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
ok but will i be able to put this into my vbscript so that it automatically does it for each and every record that is coming across as i have at least 2 million records which need the same formating done to it
 
Sorry I assumed that since you're asking in the VB5/6 Forum you wanted a VB answer.

I don't do much in VBScript, so if it doesn't work try asking in the VBScript forum


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top