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

Formula for LastYearYTD and LastYear(all) Sales Figures

Status
Not open for further replies.

jagmb5555

Technical User
Mar 7, 2004
3
US
If I use lastyearYTD formulas, it relies on system date or Report SET DATE & TIME. I need to be able to use a Parameter defined date to measure Current Year To Date and Last Year To Date vs System Date or Set Date.
 
Try this.

Given a date parameter {?Parmdt}, then

Code:
(
{table.date} in dateserial(year({?ParmDt}-1),1,1) to dateserial(year({?ParmDt}-1),month({?ParmDt}),day({?ParmDt})) or
{Table.date} in dateserial(year({?parmDt}),1,1) to {?parmDt}
)


The beauty of this is that it does not require a formula and the Show SQL Query will show the dates in your record selection

Cheers,
-LW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top