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!

Convert Number to Date

Status
Not open for further replies.

kutoose

Technical User
Sep 11, 2002
169
0
0
US
I have a database field in 'Number format'. I need to convert it to date.

The number is of format YYYYMMDD. For example 20050920 stands for 2005/09/20. I could not find a function which directly do the conversion. Can any one help me with a formula which convert it to date ?

Crystal Reports Version XI

Thanks
 
NumbertoDate() is the function.

I thought this was a part of Crystal XI, hoever if it is not then you can download the .dll for this from the business objects website.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Try aformula of:

whileprintingrecords;
stringvar MyDate: = totext({table.datefield},0,"");
cdate(val(left(Mydate,4)),val(mid(mydate,5,2),val(mid(mydate,7,2))

Replace {table.datefield} with your date field.

-k
 
u can use pwformatdate() function

------------------------------------------
A Man can be only as happy.. as he makes up his mind to be
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top