I am making a view to return the Sum of acreage records grouped by location. the view runs fine but i would like to use something like an IIf function to return the value "1" if the summation of acreage records is greater than 1. My code is as follows, sorry i forgot how to make code look like code in here:
SUM(dbo.tblTractLeaseAcres.ConfirmedNetAcres)/ dbo.tblTractInfo.TractGrossAcres AS Expr1
This works great i would like to make it:
IIf((SUM(dbo.tblTractLeaseAcres.ConfirmedNetAcres)/ dbo.tblTractInfo.TractGrossAcres) > 1, 1, SUM(dbo.tblTractLeaseAcres.ConfirmedNetAcres)/ dbo.tblTractInfo.TractGrossAcres) AS Expr1
when i do that i get the error:
'Error in list of function arguments: '>' not recognized.
Unable to parse query text.'
so i obviously don't understand how sql works there are greater than and equal to signs in the WHERE already and it works so... I don't understand how you can use the IIf function at all if you can use a >,< or =
this is really hanging me up I would greatly appreciate any help.
Thanks!
Lost
SUM(dbo.tblTractLeaseAcres.ConfirmedNetAcres)/ dbo.tblTractInfo.TractGrossAcres AS Expr1
This works great i would like to make it:
IIf((SUM(dbo.tblTractLeaseAcres.ConfirmedNetAcres)/ dbo.tblTractInfo.TractGrossAcres) > 1, 1, SUM(dbo.tblTractLeaseAcres.ConfirmedNetAcres)/ dbo.tblTractInfo.TractGrossAcres) AS Expr1
when i do that i get the error:
'Error in list of function arguments: '>' not recognized.
Unable to parse query text.'
so i obviously don't understand how sql works there are greater than and equal to signs in the WHERE already and it works so... I don't understand how you can use the IIf function at all if you can use a >,< or =
this is really hanging me up I would greatly appreciate any help.
Thanks!
Lost