You would need to OpenRecordset on a query like this:
SELECT DISTINCT DateReceived
FROM tblComplaints
WHERE (ResolvedStage <>'Resolved')
OR (ResolvedStage Is Null)
ORDER BY DateReceived;
Then loop through the records to build the string to use in the PIVOT
clause.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I've writen the following SQL in Excel using DAO:
>
[quoted text clipped - 9 lines]
>
> Thanks
DWDZEB40 - 07 Nov 2006 10:23 GMT
Thanks Allen.
> You would need to OpenRecordset on a query like this:
> SELECT DISTINCT DateReceived
[quoted text clipped - 19 lines]
> >
> > Thanks