Calculating a percentage using the current month

S

Susan L

I have a report based on a crosstab query that contains data for each month
of the year (columns, txtJan,txtFeb, etc) for each of 7 values (rows:
[Function Type]: "Locate", "Case Status" etc). [txtJan] etc are calculated as
a Sum by the query. The percentage to be calculated each month is the current
month/2862.

The logic I settled on to determine the current month is: If [Function Type]
= "Locate" And if [txtJan] is not empty and if [txtFeb] is empty,
[txtJan]/2862. (I don't know whether to use "IsEmpty" or "IsNull". Have tried
both with no luck.)

Here's what the report should look like:
Function Type Jan Feb Mar etc %
Locate 2628 91.8
Case Status 2464 86.1
I've not been able to find the correct syntax to accomplish this.

Here's my latest effort:

=IIf([Function Type]="Locate"
And IIf (IsNull[txtFeb]=â€â€)
And IIf (Not IsNull [txtJan])), FormatPercent([txtJan]/(2862),2),
IIf([Function Type]="Case Status Information"
And IIf (IsNull[txtFeb])
And IIf (Not IsNull[txtJan])), FormatPercent([txtJan]/(2862),2)â€â€)))

I surely would appreciate help -- and with apologies for adding yet another
query on IIf statements to the newsgroups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top