Les Isaacs
Registered User.
- Local time
- Today, 18:30
- Joined
- May 6, 2008
- Messages
- 184
Hi All
I thought I knew how to use Count/Select distinct, but apparently not!
I have this:
The query runs, but the value shown in the 1st column [CountOfOrder #] isn't right - for each OrderDate it's giving a count of all the records for each [order #], rather than a count of each unique [order #] value, which is what I want.
I'm sure it's obvious, but not to me!
Hope someone can help.
I thought I knew how to use Count/Select distinct, but apparently not!
I have this:
Code:
SELECT DISTINCT Count([Order #]) AS [CountOfOrder #], Sum([qty]*[Item's Price]) AS [Value], OrderDate
FROM tbl_orders
GROUP BY OrderDate;
I'm sure it's obvious, but not to me!
Hope someone can help.