Control source code problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm stumped (again)... but making progress.

I'm trying to sum "retail volume" with a constraint to do so only when a
specific field, "Project Type" is = "A WORD GOES HERE"

I've tried this, but it throws an error when I add the "where" part:

=Sum([Retail Volume]) WHERE [Project Type] = Allied)

Thanks,
Adam
 
Try this (I haven't tested it, but it is worth a try)
=IIF([Project Type] = Allied, Sum([Retail Volume], "")
 
I'm stumped (again)... but making progress.

I'm trying to sum "retail volume" with a constraint to do so only when a
specific field, "Project Type" is = "A WORD GOES HERE"

I've tried this, but it throws an error when I add the "where" part:

=Sum([Retail Volume]) WHERE [Project Type] = Allied)

Thanks,
Adam

=Sum(IIf([Project Type] = "Allied",[Retail Volume],0))
 
=Sum(IIf([Project Type]="Allied",[A-B Retail Volume],Null)) worked perfectly.

One more variation... is there any way to have the result display "n/a" if
there aren't any results to display? For exmaple, the result is blank if
there aren't any project types with the name "Allied."

You all are wonderful.

-AZ

fredg said:
I'm stumped (again)... but making progress.

I'm trying to sum "retail volume" with a constraint to do so only when a
specific field, "Project Type" is = "A WORD GOES HERE"

I've tried this, but it throws an error when I add the "where" part:

=Sum([Retail Volume]) WHERE [Project Type] = Allied)

Thanks,
Adam

=Sum(IIf([Project Type] = "Allied",[Retail Volume],0))
 
How would I add a second conditional? (The Packet Sent to Wholesaler YN is a
"true/false" field.) I tried the code below but the field is blank.

=Sum(IIf([Project Type]="Allied" & [Packet Sent to Wholesaler
YN]="true",[Allocated Case Volume],Null))


Thanks!
-AZ


John Spencer said:
=Sum( IIF([Project Type] = "Allied", [Retail Volume], Null))

AdamZ said:
I'm stumped (again)... but making progress.

I'm trying to sum "retail volume" with a constraint to do so only when a
specific field, "Project Type" is = "A WORD GOES HERE"

I've tried this, but it throws an error when I add the "where" part:

=Sum([Retail Volume]) WHERE [Project Type] = Allied)

Thanks,
Adam
 
=Sum(IIf([Project Type]="Allied" AND [Packet Sent to Wholesaler YN]=
True,[Allocated Case Volume],Null))

AdamZ said:
How would I add a second conditional? (The Packet Sent to Wholesaler YN
is a
"true/false" field.) I tried the code below but the field is blank.

=Sum(IIf([Project Type]="Allied" & [Packet Sent to Wholesaler
YN]="true",[Allocated Case Volume],Null))


Thanks!
-AZ


John Spencer said:
=Sum( IIF([Project Type] = "Allied", [Retail Volume], Null))

AdamZ said:
I'm stumped (again)... but making progress.

I'm trying to sum "retail volume" with a constraint to do so only when
a
specific field, "Project Type" is = "A WORD GOES HERE"

I've tried this, but it throws an error when I add the "where" part:

=Sum([Retail Volume]) WHERE [Project Type] = Allied)

Thanks,
Adam
 
Back
Top