Thanks
However, the query result does not show the days columns headings.
It only gives total counts for each clinic but not by date.
Pivot Choose([run date]-[vis date]<=2,"1-2 days",[run date]-[vis
date]<=7,"3-7 days",[run date]-[vis date]<=30,"10-30 days",True,"30+")
Michel Walsh said:
Change the CHOOSE for:
CHOOSE([run date]-[visit date] >=2, "1-2 days", ... )
Vanderghast, Access MVP
Michel Walsh said:
TRANSFORM Nz(COUNT(*), 0)
SELECT clinicID
FROM tableName
GROUP BY clinicID
PIVOT CHOOSE( visitDate>=date()-2, "1-2 days",
visitDate >= date()-9, "3-9 days",
visitDate >= date()-30, "10-30 days",
true, "30+")
Note that you were having a 'hole' (For days 8 and 9), so I assume it
was
9 rather than 7.
Hoping it may help,
Vanderghast, Access MVP
Hello All
Please assist.
I need to create a crosstab query that will count patient visits
between 2 dates in the table.
dates: report rundate - visit date
clinic id 1-2 days 3 -7 days 10-30 days 30+
6 10 50 60
Thanks