Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invoice Total

Status
Not open for further replies.

ebase

MIS
Jan 7, 2004
40
US
Hello,

I am using Crystal Report 8.5 with MAS90 and I am editing the SalesCommissionReport. Currently it shows all of the data in which I only want to show to show the current month. I was able to fix this by adding month({ARE_SalesperCommDetail.InvoiceDate} ) <> month(CurrentDate) into the formula for Supressing in the details section but the Invoice totals shows the totals for all of the details, including the ones that have been supressed. Is there a way I can show the total for just the ones that are showing on the report?

Thanks in advance,
Kei
 
Select Report->Edit Selection Formula->Record and place:

month({ARE_SalesperCommDetail.InvoiceDate} ) = month(CurrentDate)
and
year({ARE_SalesperCommDetail.InvoiceDate} ) = year(CurrentDate)

This will give you this years' data except for this month. Otherwise you'd get all years' data for everything except for that month number, which I assume you don't want.

-k
 
thanks. i removed my formula in the details and just added this where you showed me and it look slike its working. It is only showing the data for this year/this month.

Is there a way to tweak this code so I can now only have last month?

thank for your quick reply, I really appreciate it.

Kei
 
Try:

month({ARE_SalesperCommDetail.InvoiceDate} ) = month(CurrentDate)-1
and
year({ARE_SalesperCommDetail.InvoiceDate} ) = year(CurrentDate)

-k
 
Oh wait...

Try:

if month(currentdate) = 1 then
(
month({ARE_SalesperCommDetail.InvoiceDate} ) = 1
and
year({ARE_SalesperCommDetail.InvoiceDate} ) = year(CurrentDate)-1
)
else
(
month({ARE_SalesperCommDetail.InvoiceDate} ) = month(CurrentDate)-1
and
year({ARE_SalesperCommDetail.InvoiceDate} ) = year(CurrentDate)
)

-k
 
thanks again!

i was looking around the forums and used some similar looking code and went with this:

Created a field @field:
local NumberVar currentMonth;
if (month(CurrentDate) = 1.00 ) then
currentMonth := 12.00
else month(CurrentDate) - 1.00

then at the 'Record' formula, i entered:

month({ARE_SalesperCommDetail.InvoiceDate} ) = {@field}

This looks to be working at the moment. For now I don't have to worry about the year as we will be purging the data yearly. I will keep you code though. Thank you very much for your help, I really appreciate it!

Kei
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top