Null might not be the right term but for all intents and purposes you'll get the idea. I have a query that is supposed to sum the prior quarter(s) monthly adjustments however it is possible that no such adjustments exist. This number is then passed on to another query that totals this with a similar result from another query (for prior payments). The problem I’m having is that if there were no prior adjustments then the query passes what I believe is a null value and when added to an existing value from the second query produces yet another null value. I've tried several IIF Is Null variations to produce a 0 if no total is produced but nothing seems to work for me.
The query's sql is set up the following way...
Any idea on how to produce a value of 0 if no total is produced?
[/SIZE]
The query's sql is set up the following way...
Code:
[FONT=Calibri][SIZE=3]SELECT Sum(Adjustments.Adjustment) AS PriQtrAdj[/SIZE][/FONT]
[SIZE=3][FONT=Calibri]FROM UR_Form LEFT JOIN Adjustments ON UR_Form.Ye = Adjustments.Adjustmentyear[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]WHERE (((Adjustments.Adjustmentyear)=[Ye]) AND ((Adjustments.Adjustmentmonth)<IIF([QTR]=2,4,IIF([QTR]=3,7,IIF([QTR]=4,10)))) ((Adjustments.Company)="[Co]))</font" AND>[/FONT]
[SIZE=3][FONT=Calibri]GROUP BY UR_Form.ID[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]HAVING (((UR_Form.ID)=1));[/FONT][/SIZE]
[/SIZE]