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!

How to enter prior week on a script?

Status
Not open for further replies.

harryhoudini66

Technical User
Jun 20, 2006
90
US
Hello,

I know for the daily reports you can enter the prior day as -1. How would you enter a prior week? I created a script to run totals for the prior week. Problem is the date is hard coded. I want to see if there is a way to tell the script to use the week prior to the report being ran. Hope this makes sense.

Thanks,

 


Change the Rep.SetProperty "Dates" setting in the script.

If you want to run the report for last week today you would change it to: Rep.SetProperty "Dates","-10--4"

But you have to run it on the same day everytime to get this to work. If you run this tomorrow it wouldn't work.

So say you want to run it every Monday for the previous week you would set it to:

Rep.SetProperty "Dates","-8--2"

- Stinney

I love learning and passing on knowledge. "Because knowing is half the battle".... GI JOOOOOE!
 

Or when you run the report to create the script enter the days as -XX--X, run the report and then script it, same as the daily reports.

- Stinney

I love learning and passing on knowledge. "Because knowing is half the battle".... GI JOOOOOE!
 
Thank you so much. That is exactly what I need to do. I want to run the prior week report every Monday. So in this case -10 means going back two Sundays and -4 means going back to prior Sunday?

While on topic, how would I enter the prior month?

Thanks again, this is a great help.
 

-10 from today is 2 Sunday's ago.

-4 from today is Saturday.

Previous month change the Rep.SetProperty "Dates" setting to: Rep.SetProperty "Dates",DateSerial(Year(Date), Month(Date) - 1, 1)

- Stinney

I love learning and passing on knowledge. "Because knowing is half the battle".... GI JOOOOOE!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top