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

Converting a number to a date 1

Status
Not open for further replies.

mrshardee2

Technical User
May 24, 2004
29
US
I have a number field that I am pulling into a report from an AS400 database. The field is 3-4 digits for the month and day (Jan 14 = 114, Nov 23 = 1123). How can I convert this to a date field in CR 8.5 for reporting purposes. It seems like it should be so easy...

Probably will be for you seasoned reporters! :)

Thanks!
Amber [peace]
 
To make it a data type of date, you would also need a year field. In the following, I've hard-coded the year to 2004, so if you have a year field, you would substitute that for "2004":

date(2004,val(left(totext({table.number},"0000"),2)),
val(right(totext({table.number},"0000"),2)))

Substitute your actual field name for {table.number}.

-LB
 
I can't have a year in the report for this field. I'm trying to list employee birthdays and mgmt. wants the year excluded. Any other suggestions?

Amber [peace]
 
I've got it! Your coding worked and I just formatted the date without the year. Thanks! :)

Amber [peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top