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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert a Date in string format into Date format 2

Status
Not open for further replies.

adam7

Technical User
Nov 26, 2002
20
GB
Hi there, I currently have a table that has a field which represents the log in times of a system. it reports this to a string field in this format....

YYYMMDD_HH:MM

The underscore is not there, but it's a space. So at the moment it looks like '20060308 11:22'

I'm sure it's not difficult but I haven't got the time to figure it out. I need to be able to create a date field from that and a time field, so two different fields I can then build report parameters on.

Thanks for looking (and hopefully helping!)
 
Try:

//{@date}:
date(val(left({table.string},4)),val(mid({table.string},5,2)),val(mid({table.string},7,2)))

//{@time}:
time(val(mid({table.string},10,2)),val(mid({table.string},13,2)))

PS. I didn't have time to figure it out either :).

-LB
 
Thanks for that. I've got a feeling you spent about 2 mins on that, where as it'd taken me all day, so you've saved me tons!

Thanks again

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top