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!

Formating Expression to date/time when not recognized as date time 1

Status
Not open for further replies.

Kakoivini

Programmer
Dec 2, 2004
15
US
Greetings all

CR9, Informix procedure, Unix database.

I am having a recurring problem with getting my crystal report to see an informix datetime year to second as a date/time. Creating the problem of not being able to format the field the way I need but rather the way the expression returns the date/time (currently 2004-11-01/time). I do not have a formula for this field, the expression is coming straight from the procedure to the report. Any help would be appreciated. I can create a formula for this if needed-just need to know how. :)

Thanks!!
 
You could create a formula to convert it to a datetime, but you'll have to learn it's format first. When you speak of a data element, show an example of what's in there, it's not that much more effort.

You can try using:

cdatetime({table.field})

If that fails, parse it out in this format:

cdatetime(year,month,day,hour,minute,second)

So use the val() function around the mid() function to extract each element, as in:

cdatetime(val(mid({table,field},1,4)),val(mid({table,field},6,2)),val(mid({table,field},9,2)),...parse the time...)

-k
 
Thanks!

The first one worked-it was too simple, but now I know. Thanks a bunch!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top