Monday, March 26, 2012

If date is in range then

What is probably incredibly easy to do, I am having problems with. All I want to do is to pick up whether or not a date is in a specific range, and if it is then output the end of the month date.

here is the code I started:

if {ar_invoices.arih_invoice_date} >= Date(01/01/2005) and {ar_invoices.arih_invoice_date} <= date(01/31/2005)
then
"01/31/2005"

else
if {ar_invoices.arih_invoice_date} >= date(02/01/2005) and {ar_invoices.arih_invoice_date} <= date(01/28/2005)
then
"02/28/2005"

else
if {ar_invoices.arih_invoice_date} >= date(03/01/2005) and {ar_invoices.arih_invoice_date} <= date(03/31/2005)
then
"03/30/2005"

else
if {ar_invoices.arih_invoice_date} >= date(04/01/2005)
then
"Has not been invoiced yet"

I will eventually continue the code, but want to make sure it works first

Let me know if you need more clarification!

Thank you so much!Looks like the date format was incorrect.

for those who may be stuck on the same thing here's the code:

if {ar_invoices.arih_invoice_date} >= Date(2005,1,1) and {ar_invoices.arih_invoice_date} <= date(2005,1,31)
then
"01/31/2005"

else
if {ar_invoices.arih_invoice_date} >= date(2005,2,1) and {ar_invoices.arih_invoice_date} <= date(2005,2,28)
then
"02/28/2005"

else
if {ar_invoices.arih_invoice_date} >= date(2005,3,1) and {ar_invoices.arih_invoice_date} <= date(2005,3,30)
then
"03/30/2005"

else
"Has not been invoiced yet"

No comments:

Post a Comment