criteria with query

Bladerunner

Registered User.
Local time
Today, 11:35
Joined
Feb 11, 2013
Messages
1,799
Can I place a criteria in a calculated field? [SellingWgt]*[SellingPrice] is ok but only
if [SellingUnits] = "lbs" or [tblSellingUnits].[SellingUnitsID] = 1

Just have a problem finding it in the tutorials
icon7.gif


Blade
 
I don't use calculated fields, but I would assume the query would (or could) include either of those fields, and the criteria would be on them.
 
I don't use calculated fields, but I would assume the query would (or could) include either of those fields, and the criteria would be on them.

OK,,,thanks

Blade
 
Yes you can
Use iif()
You need to set what will it get in other cases, or it will be null
 
Yes, sir: it is working fine with IIF statement in the top row.

Total Price: IIf([SellingUnits]="lbs",[SellingWgt]*[SellingPrice],[SellingPrice]*1)


Thanks pbaldy

Blade
 
I think I misunderstood what you were after, but glad you got it sorted.
 
Yes, sir: it is working fine with IIF statement in the top row.

Total Price: IIf([SellingUnits]="lbs",[SellingWgt]*[SellingPrice],[SellingPrice]*1)


Thanks pbaldy

Blade

You can use as asked in your first post:
Total Price: IIf([SellingUnits]="lbs" or [tblSellingUnits].[SellingUnitsID] = 1,[SellingWgt]*[SellingPrice], [SellingPrice])
 

Users who are viewing this thread

Back
Top Bottom