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

When in the formula editor, Start out by typing the first charter of the function, press Ctrl-Space. The keyword auto complete will than show a list of the functions available beginning with the charter you typed in.

ADVERTISMENT