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

anniversary date

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
US
Hello,

Im trying to write a function which will calculated the anniversary date on a field, 'date of hire', I've done

DOH = 'TODAYM365', but this only displays the previous years date, as I would like it to generate the records for every year M365.

i.e. each record where 'date of hire' is either 11/22/2009,11/22/2008,11/22/2007,etc.


thanks
 
i am not sure what you are asking/needing, but you can use the following method in you select expert to only get results that match the current month & date.

Month({table.dateofhire})=month(currentdate)
and
day({table.dateofhire})=day(currentdate)
 
that works great if Im running the report for the current day, is there any way to set it if I want to specify a range of the 'date of hire'

for example if I want to pull any records where the 'date of hire' is between 11/15..11/19 for any year

thanks
 
rrmcguire,

I don't have anything to test this theory on, but if you have a selection range, and group on the field of the range (for each day) - perhaps you can link the group to the Day({Table.DateOfHire}) in place of Day(CurrentDate) in the suggestion above?

Wish I had some data that would work to test that out before suggesting it.



Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
rrmcguire,

Ironically, nearly the same request as you posted above has crossed my desk just now to develop this afternoon. I will post a solution once complete - the only difference is the request I have received is always for a calendar month, though I would think the solution easily adaptable to your question above.

Cheers!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
If you create parameters {?Start} and {?End}, you could use a selection formula like this:

(
(
date(year({?Start}),month({table.hiredate}),day({table.hiredate})) in {?Start} to {?End}
) or
(
date(year({?End}),month({table.hiredate}),day({table.hiredate})) in {?Start} to {?End}
)
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top