MrMitchell
New member
- Local time
- Today, 06:34
- Joined
- Jun 7, 2012
- Messages
- 5
Good morning all,
So I'm trying to find a solution to my query not populating fields with zeros for not found records. The problem I would like to resolve is if there is 0 records in the "Total Booked" field, I would like it to populate with 0, rather than ommitting the record. I've been snooping around some of my desk references and the internet, but can't seem to figure this one out, beyond that I need to utilize the Nz operand. Here's my SQL:
I'm just not sure where in the total booked field it should be placed, given that I'm also using a Sum(IFF(, any help would be greatly appreciated!
So I'm trying to find a solution to my query not populating fields with zeros for not found records. The problem I would like to resolve is if there is 0 records in the "Total Booked" field, I would like it to populate with 0, rather than ommitting the record. I've been snooping around some of my desk references and the internet, but can't seem to figure this one out, beyond that I need to utilize the Nz operand. Here's my SQL:
Code:
SELECT Sum(IIf(([calendar]="New Customer") Or ([calendar]="Service Customer") Or ([calendar]="Address Change"),1,0)) AS [Total Booked]
FROM matchingdocument INNER JOIN June ON matchingdocument.zipcode = [June].zipcode;
I'm just not sure where in the total booked field it should be placed, given that I'm also using a Sum(IFF(, any help would be greatly appreciated!
Last edited: