Counting days question

G

Guest

Hello All,

I am trying to count the days in a query. I want to only count each day as
1, even thought there could be more then 1 record for that date.

Example of data.

Date Wave
08/01/06 DER1234
08/01/06 DER4321
08/02/06 DER9876
08/02/06 DER9875
08/02/06 DER9874
08/03/06 DER9873
08/03/06 DER9872

I expect a result of 3. Since this data covers 3 days. When I run it now I
get a result of 7.

Here is my SQL, how can I get it to only count each data only once?

Select count(rdate) as countofrdate
From tbRunTime

I have tried to group by on date, but it would read something like this if I
did.

08/01/06 2
08/02/06 3
08/03/06 2
 
G

Guest

The SQL below will return two colums, the date and the number of times the
date appears in the table:

SELECT DISTINCT rdate, count(rdate) as countofrdate FROM tbRunTime GROUP BY
rdate;
 
G

Guest

That returns something like this below:

08/01/06 2
08/02/06 3
08/03/06 2

What results I'm expecting though is 3. Which would be the count of days
8/01, 8/02, and 8/03.

I could create another query based on this previous query, but I was hoping
it could be done in 1 step.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top