By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Query to count # of unique entries with multiple fields

P: 1
I have a database that i've been entering and I need to show how many unique entries I have entered prividing the date range.

The database includes date, productID, locationID, quantity etc.

What I'm trying to find out is the numbers of lines that is Unique date AND locationID. LocationID's are 4 digits with alphabets/number mixed.

I've looked around and only found query unique entries for 1 select field.

I have Access 2007 at work but I'm trying things out with Access that's included in Office XP.

Any helpful input would be appreciated.
Sep 9 '08 #1
Share this Question
Share on Google+
1 Reply


puppydogbuddy
Expert 100+
P: 1,923
I have a database that i've been entering and I need to show how many unique entries I have entered prividing the date range.

The database includes date, productID, locationID, quantity etc.

What I'm trying to find out is the numbers of lines that is Unique date AND locationID. LocationID's are 4 digits with alphabets/number mixed.

I've looked around and only found query unique entries for 1 select field.

I have Access 2007 at work but I'm trying things out with Access that's included in Office XP.

Any helpful input would be appreciated.
hi,

try

Expand|Select|Wrap|Line Numbers
  1. SELECT [date], locationID, productID, quantity, Count(UniqueEntry)
  2. FROM  (SELECT DISTINCT [date], locationID, ([date] & [locationID]) As
  3.                           UniqueEntry FROM YourTable)
  4. GROUP BY [date], locationID, productID 
  5. ORDER BY [date], locationID, productID
  6.  
Sep 9 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.