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

Date-Previous Week-Parameter Query

Status
Not open for further replies.

Moustrik2001

Technical User
Feb 7, 2005
2
US
I need to have a query list only the jobs awarded the previous week. I will be printing the list every Monday morning and it should include the previous week's (M-F)awards. I have tried several expressions listed on here for the last few hours and none of them seem to work. I'm missing something. Please help.

Thank you in advance,

Becky
 
Try the following:

Create a date range parameter and create a default of 1/1/1970.

Go to the Report->Select Formulas->Record and place something like:

if minimum({?MyDateParameter}) <> cdate(1970,1,1) then
{table.date} = {?MyDateParameter}
else
{table.date} in lastfullweek

This will return everything for the previous Sunday to Saturday if you leave the dates at 1/1/1970, otherwise if you enter dates, it will return for the date range you enter.

If you only want the weekdays (Does this mean you will need to filter out Holidays???), then try:

if minimum({?MyDateParameter}) <> cdate(1970,1,1) then
{table.date} = {?MyDateParameter}
else
{table.date} > minimum(lastfullweek)
and
{table.date} < maximum(lastfullweek)

If this is to run every Monday, you should consider scheduling it, in which case my formula should still work because of the default value.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top