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

date formula problem

Status
Not open for further replies.

jmd0252

Programmer
May 15, 2003
667
ok first this is not my formula.

stringvar x := {PM_EMPMASTER.BIRTH_DATE};
datevar birth := date(val(left(x,4)),val(mid(x,5,2)),val(right(x,2)));
DateVar Ann := jdyear; // Replace this with CurrentDate to get their age as of the time of the report
//or the date field of an event to get their age as of the time of that event.
if (Month(Ann) * 100) + Day (Ann) >=(Month(Birth) *100) + Day (Birth)
then Year (Ann) - Year(Birth)
else Year (Ann) - Year(Birth) -1

now if I use "currentdate", for jdyear the formula calculate the age of the person, at run time of report.

I have added the parameter jdyear,, defined as a date, so you can enter the end of the year,, and see who will be what age during the year.

the formula editor kicks using the jdyear,,

"a number, currency amount, etc etc is expected her", so it does not seem to be recognizinf that my parameter is a date,, solution???
 
I just tested this using a date parameter and it worked fine, so I would double check the datatype of the parameter.

The formula is Ken Hamady's by the way.

-LB
 
ok on my parameter,, I have the name,, type which is date,, and everything else is just defaults,, what in the world am I missing.. if I put it on the report,, it prints as 12/31/2009,, so what am I missing..
 
Well isn't this fun.. I decided to do it the "point and click" way,, highlighted the name,, backspace,, the double clicked the parameter name,, and there are () around the name.. it works so well now,,, DOH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top