scriptscribe
MIS
Hi,
I have a table that looks like this:
AdmitDate AcctNum
2005-03-04 5713513
2005-05-11 5713683
2005-05-18 5714069
2005-06-01 5714138
2005-06-03 5714152
2005-06-05 5714153
2005-06-05 5711825
I want to be able to count by both distinct AcctNum AND AdmitDate, because there will be some duplicate AcctNums for the same AdmitDate and some duplicate AcctNums with different AdmitDates. So in other words, I want a count of each unique AcctNum for each AdmitDate.
I tried this:
...but got an error message saying that COUNT can't be used with more than one column.
Any help would be greatly appreciated.
Thanks,
Mike
I have a table that looks like this:
AdmitDate AcctNum
2005-03-04 5713513
2005-05-11 5713683
2005-05-18 5714069
2005-06-01 5714138
2005-06-03 5714152
2005-06-05 5714153
2005-06-05 5711825
I want to be able to count by both distinct AcctNum AND AdmitDate, because there will be some duplicate AcctNums for the same AdmitDate and some duplicate AcctNums with different AdmitDates. So in other words, I want a count of each unique AcctNum for each AdmitDate.
I tried this:
Code:
select count(DISTINCT(AcctNum, AdmitDate)) from KnownMedicaid
...but got an error message saying that COUNT can't be used with more than one column.
Any help would be greatly appreciated.
Thanks,
Mike