Hi all,
CR 10
CE 10
SQL 2000
I am creating a formula to set the date range of a report that is to be run on the 25th of the month. What I want it to do is include data from the 25th - end of the previous month as well.
Here is what I have created to find the end of the previous month and then subtract from the currentdate to get my range but it is not working. It only seems to be looking at the first conditional.
{@Formula} =
{Table.DateCreated} >=
if (datepart ("d",(maximum( LastFullMonth)))= 30)
then (dateadd ("d", -31, Currentdate))
else
if (datepart ("d",(maximum( LastFullMonth)))= 31)
then (dateadd ("d", -32, Currentdate))
else
if (datepart ("d",(maximum( LastFullMonth)))= 28)
then (dateadd ("d", -29, Currentdate))
else
if (datepart ("d",(maximum( LastFullMonth)))= 29)
then (dateadd ("d", -28, Currentdate))
Let me know if there is a better way.
Thanks
BB
CR 10
CE 10
SQL 2000
I am creating a formula to set the date range of a report that is to be run on the 25th of the month. What I want it to do is include data from the 25th - end of the previous month as well.
Here is what I have created to find the end of the previous month and then subtract from the currentdate to get my range but it is not working. It only seems to be looking at the first conditional.
{@Formula} =
{Table.DateCreated} >=
if (datepart ("d",(maximum( LastFullMonth)))= 30)
then (dateadd ("d", -31, Currentdate))
else
if (datepart ("d",(maximum( LastFullMonth)))= 31)
then (dateadd ("d", -32, Currentdate))
else
if (datepart ("d",(maximum( LastFullMonth)))= 28)
then (dateadd ("d", -29, Currentdate))
else
if (datepart ("d",(maximum( LastFullMonth)))= 29)
then (dateadd ("d", -28, Currentdate))
Let me know if there is a better way.
Thanks
BB