Forum Moderators: open
Sample Record:
Time in:"10-05-2005 15:39"
ED MD:"Name"
I need the total records for the day, then the total records where [ed md] is not null
SELECT Timein, Count(timein), Count([ED MD]) AS [Peg Visits]FROM Accounts
when this statement is run, it just gives 1 for each count, because it count the timein field with the Date, and the Time. I just want it to use the date to count with.
Can't use a where edmd is not null statement, because that won't total the ED Visits for the day.
SELECT DateValue(timein) AS [Date], Count(DateValue(timein)) AS [ED Visits], Count(EDMD) AS [Peg Visits]
FROM acctinfo
GROUP BY DateValue(timein);
Example records:
TimeIn¦ EDMD ¦
10-05-2005 15:30 ¦Jones¦
10-05-2005 13:28 ¦(null)¦
01-01-2005 11:00 ¦Smith ¦
Results should be:
Date¦ED Visits¦Peg Visits¦
10-05-2005 ¦2 ¦1 ¦
01-01-2005 ¦1 ¦1 ¦