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!

YeartoDate formula

Status
Not open for further replies.

ajoyp2

MIS
Apr 25, 2007
8
0
0
US
I want to create a chart which will compare the Last 3 years records to current month yearwise, eg FY05,FY06 and FY07 . FY05 should be July04 to April06 (current month) and so on .Further we also need a comparison month wise and weekwise . How can the YeartoDate or MonthtoDate function be used for previous years ?
 
An example of the last 3 years record selection:

{table.date} in dateadd("ytty",-3,maximum(yeartodate))+1
to
maximum(yeartodate)

So then each year would be similarly identified:

{table.date} in dateadd("yyyy",-3,maximum(yeartodate))+1
to
{table.date} in dateadd("yyyy",-2,maximum(yeartodate))

etc...

Looks about right.

-k

 
Thanks but I couldn't this formula to work ,
Can there be a record selection for 4 different dates ( or 2 date ranges ) for eg records between (July05- Currentdate-365 ) and ( July06- Currentdate)?
 
If you don't post what you tried, I can't help you with it.

A date -365 is not a year, there are leap years.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top