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!

using current date to select parameters of automated report

Status
Not open for further replies.

funkmonsteruk

IS-IT--Management
Joined
Feb 8, 2002
Messages
210
Location
GB
i have a BO report which runs on automatically on a sunday evening and is a summary of data created throughout the week.

The conditional field is called <created> and i would like the report to include records with a created date of within the last seven days. I currently run the report manually and insert the required date in a promt as the document opens.

Is it possible to add some vba code that will automatically insert this date as being seven days before the document is opened, thus automating it?

Any help will be gratefully accepted
 
Do you actually need VB code? Could you not refer to the system date?

In an Oracle environment I could use the clause


select ....
from ...

where records.created > sysdate -7


I compare the &quot;created&quot; date with the date seven days before that in the system clock - in your case always a Sunday's date.
 
The equivalent on DB2 is
[tt]
CURRENT DATE - 7 DAYS
[/tt]
Use that instead of the @Prompt or @Variable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top