var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Using IIf function on a form
I have a form that runs from a query that shows both fields from a table and some calculations.
Not all the records in the table have data in the fields required to do the calculations. Since they don't have the data required for the calculations they do not appear in this query.
What I'm wanting to do is get all the records to show regardless of whether they have all the data and for those records with the data I just want it to show as 0 in those fields.
I think I need to use the Iif function to check if there is any data for the calculation to take place and if there is to show it and if not to show as 0.
eg IIf("Calculation1 = "" ","SHOWS THE CALCULATION", "0")
I can't figure out how to write this so if any one can help me out it would be greatly appreciated.
Try soemthing like:-
IIf (<mycolum>=<value>,<trueexpression>,<falseexplress ion) AS <mySQLResult>
iif(not isnull(NoHours),NoHours*Rate,0) as billableitem should do the trick
just as an after thought does the caluclaution need tobe done in the query - could it be usefully done in the form or report. Agree in a query is almost certainly preferable
The Calculation Is Done In The Query
nz() is another option:
nz(NoHours * Rate, 0)