Ok I have another fun (sarcasm) Question I hope someone can help me with.
In a nutshell I have a Crosstab query using the COUNT function with Dates as the column heading and different categories as the rows and I can’t retrieve a full record set because some Days have no records.
My problem is that is some cases for a given day(s) that has NO data, (no records at all for the given criteria). I miss the day or day’s in my output.
So for reporting purposes (in Excel) I have to look at all the days (sometimes YTD) and add the Date and a zero value for that day.
So for example I get.
Category 6/1 6/3 6/4 6/6
Printer 3 2 3 8
I retrieve no count (hence no column) for June 2 and June 5
What I want is:
Category 6/1 6/2 6/3 6/4 6/5 6/6
Printer 3 0 2 3 0 8
Here is my SQL Code:
TRANSFORM IIf(Sum([Count]) Is Null,0,Sum([Count])) AS Expr1
SELECT [Daily]. CATEGORY
FROM [Daily]
WHERE ((([Daily].CATEGORY)="HARDWARE") AND (([Daily].DATE) Between Date()-13 And Date()-1))
GROUP BY [Daily RADAR_STORE].CATEGORY
PIVOT [Daily].DATE;
----------------------------------------------------------------------
I tried the IIF(ISNULL.. and NZ function but no luck.
Please help!!! Any suggestions would be appreciated!
Thanks,
Boxcar