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!

Creating Date field from numeric YYYYMMDD

Status
Not open for further replies.

Reebo99

MIS
Jan 24, 2003
1,074
GB
Hello everyone,

Not sure if people are aware you can do this, but it helps me a whole lot.

If you have a Numeric field YYYYMMDD or 20030101 then rather than using :

date(left(totext(20030101,0),2),mid(totext(20030101,0),5,2),right(totext(20030101,0),2))

Use :

Date(ToText(20030101,"####,##,##"))

Works a treat! [peace] Reebo
Scotland (Going mad in the mist!)
 
Better yet, download the free UFL on the crystal decisions website for the NumbertoDate() function.

Numbertodate() takes an 8 digit interger in a YYYYMMDD format and converts it to a "real" date.

Macola and ACCPAC are 2 of the programs that I have run into that uses this date format stored as a number, but I am sure there are others. Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top