BOFocus – Crystal Reports Tips – Tricks – Tutorials

Crystal Reports - Formulas

Converting numbers to dates

Some applications store dates as eight-digit integer in the following format: YYYYMMDD For example, March 1, 2002 would be stored as 20020301. One way to convert this to date field that can be manipulated and formatted correctly is to use the following formula:

Stringvar dt := Totext({table.field},0,”"); Date(Val(dt[1 to 4]),Val(dt[5 to 6]),Val(dt[7 to 8]));
dt;

Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

GET SOCIAL

QUICK TIP

To format a report section

Right-click the report section and click Format Section.

ADVERTISMENT