gregory.west Posted February 14, 2016 Share Posted February 14, 2016 SELECT parts.*, (iif(parts.lastcost > 25,parts.lastcost*1.40,parts.lastcost*2) as idealsell, partsgroup.* FROM partsgroup INNER JOIN parts ON parts.partsgroup_id = partsgroup.id WHERE sellprice 1.05 <= idealsell and not (obsolete) order by description What I want is the selected parameter idealsell to be 1.4* last cost, unless lastcost is less than 25 in which case make idealsell twice last cost. Ideal sell is being used over and over again in the report, so simpler to set ideal sell at the select time if possible. Link to comment Share on other sites More sharing options...
javier.ggi90 Posted February 15, 2016 Share Posted February 15, 2016 I'm not sure about this specific statement but it should be possible. I have done similar things using MySQL and Oracle with CASEs instead of IFs.As an alternative, you can also do this in a view or stored procedure and call it from the report query. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now