diglife
asked on
Need to know how to write a "conditional query" in Access 97? : o /
Ok...i have a problem ...i have a query that generates a calculation in a field called Salesman Overage. Below is the formula for the field:
Salesman overage: [Commissioncalc]-([Cabinet Net]+[Fin Mat'l])
This works fine as long as JobCost < ContractPrice.
What i need to do is be able to write something that says If the JobCost > Contract Price then i need it to run an alternate forumula that looks like this:
Salesman overage: [Total]-[ContractPrice]
Is there some sort of way to write this as a conditional if then statement in the query in that field? In other words in the field where the query has this:
Salesman overage: [Commissioncalc]-([Cabinet Net]+[Fin Mat'l])
Replace it with something that would be equivelant to this:
If jobCost < Contractprice then
Salesman overage: [Commissioncalc]-([Cabinet Net]+[Fin Mat'l])
else
Salesman overage: [Total]-[ContractPrice]
I don't want to have to create any additional fields for this. I'm very new to access so please be specific...Thanks!!
BTW..I'm working in Access 97
Salesman overage: [Commissioncalc]-([Cabinet
This works fine as long as JobCost < ContractPrice.
What i need to do is be able to write something that says If the JobCost > Contract Price then i need it to run an alternate forumula that looks like this:
Salesman overage: [Total]-[ContractPrice]
Is there some sort of way to write this as a conditional if then statement in the query in that field? In other words in the field where the query has this:
Salesman overage: [Commissioncalc]-([Cabinet
Replace it with something that would be equivelant to this:
If jobCost < Contractprice then
Salesman overage: [Commissioncalc]-([Cabinet
else
Salesman overage: [Total]-[ContractPrice]
I don't want to have to create any additional fields for this. I'm very new to access so please be specific...Thanks!!
BTW..I'm working in Access 97
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Salesman overage: iIf (jobCost < Contractprice,[Commissionc alc]-([Cab inet Net]+[Fin Mat'l]), [Total]-[ContractPrice])
man, that was SUPER fast Dave !
1 minute... quite slow actually ;)
Oh Yeah, i know what you mean ;o)
unfortunatly EE doesn't show the "seconds" in the time.
unfortunatly EE doesn't show the "seconds" in the time.
ASKER
jeez..that was quick...wish i could give ya all 500 for the help.
Thanks
Thanks
Hey diglife
Welcome to EE,
you should see Dave when he is in his full capacity, like a bullet, fast and right to the target ;o)
jaffer
Welcome to EE,
you should see Dave when he is in his full capacity, like a bullet, fast and right to the target ;o)
jaffer
Glad to help diglife!
Thanks for the kind words jaffer, you 'ant too bad youself ;)
Thanks for the kind words jaffer, you 'ant too bad youself ;)