I've searched extensively for a solution for this but can't seem to find one I can get to work although there are a few similar ones out there. Anyway... here's a sample of my data (Using Access 2000):
ActionID DMRNum Date XXXX XXXX
500001 1695 xx/xx/xxxx xxxx xxxx
500002 1695 xx/xx/xxxx xxxx xxxx
500003 1695 xx/xx/xxxx xxxx xxxx
500004 1696 xx/xx/xxxx xxxx xxxx
500005 1697 xx/xx/xxxx xxxx xxxx
500006 1697 xx/xx/xxxx xxxx xxxx
In my table there are over 700 ActionIDs (and growing). I need to build a series of charts based on unique DMRNums. There is also a date field but when I built queries using dates and grouped by DMRNums it seemed to work but I got multiple counts of duplicate DMRNums because some of them fell in different time periods (ie, yearly, quarterly, monthly).
I tried using the DISTINCT statement but it only seems to work when I use only the DMRNum field. When I include all of the fields in the SELECT statement the DISTINCT statement doesn't seem to have any effect at all.
Here is the SQL statement that works properly (simple one really):
SELECT DISTINCTROW drtrend.DMRNUMBER
FROM drtrend
GROUP BY drtrend.DMRNUMBER;
But when I add the other fields from the table it doesn't work anymore, here it is:
SELECT DISTINCTROW drtrend.DMRNUMBER, drtrend.ACTIONID, drtrend.DATEOPEN, drtrend.NON_CONFOR, drtrend.CAUSEREASO, drtrend.CORRECTIVE, drtrend.ROOTCAUSEI, drtrend.CHARACTER0, drtrend.FIELD1
FROM drtrend
GROUP BY drtrend.DMRNUMBER, drtrend.ACTIONID, drtrend.DATEOPEN, drtrend.NON_CONFOR, drtrend.CAUSEREASO, drtrend.CORRECTIVE, drtrend.ROOTCAUSEI, drtrend.CHARACTER0, drtrend.FIELD1;
I think the problem has something to do with the DISTINCTROW in that the rows are not the same but only values within. I am at a loss as to how to do this.
Many thanks in advance,
Bruce Brannan
ActionID DMRNum Date XXXX XXXX
500001 1695 xx/xx/xxxx xxxx xxxx
500002 1695 xx/xx/xxxx xxxx xxxx
500003 1695 xx/xx/xxxx xxxx xxxx
500004 1696 xx/xx/xxxx xxxx xxxx
500005 1697 xx/xx/xxxx xxxx xxxx
500006 1697 xx/xx/xxxx xxxx xxxx
In my table there are over 700 ActionIDs (and growing). I need to build a series of charts based on unique DMRNums. There is also a date field but when I built queries using dates and grouped by DMRNums it seemed to work but I got multiple counts of duplicate DMRNums because some of them fell in different time periods (ie, yearly, quarterly, monthly).
I tried using the DISTINCT statement but it only seems to work when I use only the DMRNum field. When I include all of the fields in the SELECT statement the DISTINCT statement doesn't seem to have any effect at all.
Here is the SQL statement that works properly (simple one really):
SELECT DISTINCTROW drtrend.DMRNUMBER
FROM drtrend
GROUP BY drtrend.DMRNUMBER;
But when I add the other fields from the table it doesn't work anymore, here it is:
SELECT DISTINCTROW drtrend.DMRNUMBER, drtrend.ACTIONID, drtrend.DATEOPEN, drtrend.NON_CONFOR, drtrend.CAUSEREASO, drtrend.CORRECTIVE, drtrend.ROOTCAUSEI, drtrend.CHARACTER0, drtrend.FIELD1
FROM drtrend
GROUP BY drtrend.DMRNUMBER, drtrend.ACTIONID, drtrend.DATEOPEN, drtrend.NON_CONFOR, drtrend.CAUSEREASO, drtrend.CORRECTIVE, drtrend.ROOTCAUSEI, drtrend.CHARACTER0, drtrend.FIELD1;
I think the problem has something to do with the DISTINCTROW in that the rows are not the same but only values within. I am at a loss as to how to do this.
Many thanks in advance,
Bruce Brannan