need help with a formula (1 Viewer)

dmnmak

New member
Local time
Yesterday, 16:27
Joined
Oct 12, 2009
Messages
1
For my report I would like to have crystal pull up the previous months sales data. So for example if this month is October 2009, then I would want September 2009 sales.

But I've come across a problem that I need help with, let's say that the current month is January 2010, then I would want Sales data for December of 2009. I don’t know of a formula since I would be pulling data from the previous year.

So if here is my basic formula that I have. (I need help with the first line).

If Month (CurrentDate)=1 then (Need help here);
If Month (CurrentDate)=2 then {IM9_ItemSalesDetailWhse.QtySoldPeriod1};
If Month (CurrentDate)=3 then {IM9_ItemSalesDetailWhse.QtySoldPeriod2};
If Month (CurrentDate)=4 then {IM9_ItemSalesDetailWhse.QtySoldPeriod3};
If Month (CurrentDate)=5 then {IM9_ItemSalesDetailWhse.QtySoldPeriod4};
If Month (CurrentDate)=6 then {IM9_ItemSalesDetailWhse.QtySoldPeriod5};
If Month (CurrentDate)=7 then {IM9_ItemSalesDetailWhse.QtySoldPeriod6};
If Month (CurrentDate)=8 then {IM9_ItemSalesDetailWhse.QtySoldPeriod7};
If Month (CurrentDate)=9 then {IM9_ItemSalesDetailWhse.QtySoldPeriod8};
If Month (CurrentDate)=10 then {IM9_ItemSalesDetailWhse.QtySoldPeriod9};
If Month (CurrentDate)=11 then {IM9_ItemSalesDetailWhse.QtySoldPeriod10};
If Month (CurrentDate)=12 then {IM9_ItemSalesDetailWhse.QtySoldPeriod11}
else 0

Thanks to anyone that can help me, I really appreciate it. :)
 

Kempes

Registered User.
Local time
Today, 00:27
Joined
Oct 7, 2004
Messages
327
Not sure if help is still required but you don't need to over complicate it.
All you really need to do is open up your selection criteria, and providing you are capturing the date for each record, select this field and choose = lastfullmonth
That should do the job.
 

Users who are viewing this thread

Top Bottom