fryguy5049
Technical User
CR 10 & MySQL 4
I have a DB with new data everyday except there is no data on saturdays. There are no nulls in my date field, just not a record for any date that falls on a saturday.
how can I write a formula that pulls data from the 9th day of every month and if the 9th falls on a saturday then the report should pull data from the previous day(8th).
Currently I have:
If {table1.cycle}=9 and Day ({table1.rep_date})=9 and {table1.days}=" 30-DAY"then
{table1.total_acct}
else If {table1.cycle}=9 and Day ({table1.rep_date})=8 and {table1.days}=" 30-DAY"then
{table1.total_acct}
else 0
Then I have a summary field on this formula. So the problem is next month when the 9th doesn't fall on a saturday the formula adds the data from both the 8th & 9th.
I have a DB with new data everyday except there is no data on saturdays. There are no nulls in my date field, just not a record for any date that falls on a saturday.
how can I write a formula that pulls data from the 9th day of every month and if the 9th falls on a saturday then the report should pull data from the previous day(8th).
Currently I have:
If {table1.cycle}=9 and Day ({table1.rep_date})=9 and {table1.days}=" 30-DAY"then
{table1.total_acct}
else If {table1.cycle}=9 and Day ({table1.rep_date})=8 and {table1.days}=" 30-DAY"then
{table1.total_acct}
else 0
Then I have a summary field on this formula. So the problem is next month when the 9th doesn't fall on a saturday the formula adds the data from both the 8th & 9th.