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

Invoices created last week of each month

Status
Not open for further replies.

davidmo

Technical User
Apr 8, 2003
97
US
I am trying to print a list of invoices created the last 7 days of each month for the past 18 months but am not sure the process. Any ideas?
 
Here's a quick and dirty solution:

Create a formula containing something like:

cdatetime(year(dateadd("M",-18,currentdate)),month(dateadd("M",-18,currentdate)),21,0,0,0)

I called it @18 month in the following record selection formula:

(
{Orders.Invoice Date} >= {@18 month}
)
and
(
{Orders.Invoice Date} >= cdatetime(
year(dateadd("M",1,{Orders.Invoice Date})),
month(dateadd("M",1,{Orders.Invoice Date})),
1,0,0,0)-8
and
{Orders.Invoice Date} <= cdatetime(
year(dateadd(&quot;M&quot;,1,{Orders.Invoice Date})),
month(dateadd(&quot;M&quot;,1,{Orders.Invoice Date})),
1,23,59,59)-1
)

Note that I based it on being a datetime, you may have to adjust this. if you need further help, flesh out your environment.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top