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

Date of Birth Displayed as a 810,109

Status
Not open for further replies.

cknapp

Technical User
May 22, 2001
10
0
0
US
I need to have this date displayed as 01/09/81 on my crystal report. The field in the database is defined as a number.
 
Create a couple of formulae:

//@Formula1
totext({numerical_date_field},0)

//@Formula2
whileprintingrecords;
numbervar yr;
numbervar mn;
numbervar dy;

yr := tonumber(mid({@Formula1},1,2));
mn := tonumber(mid({@Formula1},3,2));
dy := tonumber(mid({@Formula1},5,2));

numbervar yr1 := 1900 + yr;

datetimevalue(yr1,mn,dy)

Not really a great fan of hardcoding the year in a formula myself, but being as your database conspicuously has birthdate as year as YY, I'm assuming your whole db birthdates are 19XX...

Naith
 
Another formula option:

stringvar dat:=totext(19000000+{date.field},0,"");
date(val(dat[1 to 4]),val(dat[5 to 6]),val (dat[7 to 8])) Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top