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

Last recorded record based product

P: n/a
Hello

I have been trying to make an SQL statement that will get the the last
product audited in a database.

The problem is that this database holds data for several emplyees that
audit several stores. The mobile unit is filtering for user but the
amount of audit information is just too much.

Table is like this

SalesRep
Product
StoreID
TimeStamp ex. 12/14/04 5:38:06 pm
Date ex 20041412

I want to pull the latest record of each product per store per sales
rep.

Thanks for your help.

Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
GH
Have you already tried using the MAX function and grouping on each of
the fields you want?

For example:

SELECT Product, Store, SalesRep, Max(Timestamp)
FROM AuditTable
GROUP BY Product, Store, SalesRep

- GH

en***********@gmail.com wrote:
Hello

I have been trying to make an SQL statement that will get the the last
product audited in a database.

The problem is that this database holds data for several emplyees that
audit several stores. The mobile unit is filtering for user but the
amount of audit information is just too much.

Table is like this

SalesRep
Product
StoreID
TimeStamp ex. 12/14/04 5:38:06 pm
Date ex 20041412

I want to pull the latest record of each product per store per sales
rep.

Thanks for your help.


Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.