Jul 25, 2003 #1 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?
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?
Jul 25, 2003 #2 synapsevampire Programmer Mar 23, 2002 20,180 US 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("M",1,{Orders.Invoice Date})), month(dateadd("M",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 Upvote 0 Downvote
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("M",1,{Orders.Invoice Date})), month(dateadd("M",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