Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Formatting SQL Crosstab Query to return the blank fields

  Asked By: Qadriyah    Date: Mar 13    Category: MS Office    Views: 894
  

I came up with this crosstab query which gives 8 days worth of data.However,
if my database has only 6 days worth of data and 2 days in between are blank,
this query just ignores those two days and displays only 6 days.
How can I change this to display blank fields?

sSQL = " TRANSFORM Count([Open Remedy PQR].[PQR Number]) AS [CountofPQR]" & _
" SELECT [Open Remedy PQR].[Report Category]," & _
" Count([Open Remedy PQR].[PQR Number]) AS [Total of PQR Number]" & _
" FROM [Open Remedy PQR] " & _
" WHERE ([Report Category] <> '[Not Reported]'" & _
" AND ([Create-date] >= DATEADD('d',-8,Date())))" & _
" GROUP BY [Report Category] " & _
" PIVOT Format([Create-date],'yyyy/mm/dd');"

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Formatting SQL Crosstab Query to return the blank fields Or get search suggestion and latest updates.




Tagged: