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

Converting number to Date

Status
Not open for further replies.

pdef

MIS
Aug 28, 2009
3
US
I have a situation where a date is stored as a number in format yyyymmdd. That is 20090828 would be August 28 2009. I need to be able to display that at 08/28/2009. Any ideas?
 
Sorry for the lack of details here. I am using CR XI R2.
 
oh,
i should give all credit for the original formula to lbass!
thanks!!
 
Actually, I think you saw that in a thread where I made an initial mistake by not converting the number to a string, so it should be:

stringvar x := totext({table.numberdatefield},0,"");
Date(val(left(x,4)),val(mid(x,5,2)),val(right(x,2)))

Then you could format it to display however you like.

-LB
 
Thank you for the info. I think I am on my way to a solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top