473,657 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Last recorded record based product

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
1 1312
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***********@g mail.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6609
by: Melissa | last post by:
I have this table: TblProjectYear ProjectYearID ProjectYearStartDate ProjectYearEndDate The Project Year will always span across December 31; for example 9/1/04 to 6/30/05. How do I build a combobox based on this table that will display all the months between the StartDate and the EndDate for a given ProjectYearID and when a selection is made, the full date of the last day of the selected
5
1945
by: SalimShahzad | last post by:
dear gurus, can any one help me to how to store progrmatically last value in combo box. say i load access form. but in combo box the last value how it will come any ideas...as i need only programatically regards,
3
3210
by: david | last post by:
Hi, I've been reading tons of posts on how to copy records, but to no avail....i'm still stuck. There are three tables: Main, Sub-Form1 & Sub-Form2 I have a form which displays some data. The PK (ProductID) for each record on the form is an AUTONUMBER. This form also has a sub-form, linked via ProductID. The subform also
19
3463
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
2
6125
by: sheenaa | last post by:
Hi, I want to display the last recorded record in the database of SQL SERVER 2005. How can i display it with the select query in the grid view... The database contains the information which is general contact details: Name Address
3
7364
by: jclover | last post by:
When creating a query in Access (assumption is the data has a unique ID which is numerical...new records, autonumber) how reliable is the "Last of" grouping function vs the "Max of" the ID, and then linking that max of with a record in another query. I've had issues in the past where the "last" record, isn't necessarily the last record entered. In my case, I'm updating product pricing, so I always want to pull the most recently entered...
5
2840
by: Gilberto | last post by:
Hello, I have a textbox where the user enters a category for a product selected on a combo box. The user has to select a LOT of products and most of the time he enters them in order of category, so for every product (new record) he has to type AGAIN the "category" in the category textbox. Is there a way that this textbox "remembers" the last thing typed in, so that if its correct the user DOESNT have to type again???? But that he could also...
2
3680
by: Navpreet Singh | last post by:
Hello Sir The code given below is the vxml code in which i can record my voice but when i want to try to save the recorded file using php script the error occours. The php code is also given below. Please sort out thi problem. Thank you. record.xml <?xml version='1.0'?>
10
6238
by: puT3 | last post by:
I want to get the value from Product_Price field which it will display it record on a text box based on a product that is selected from a list box. Product Table Product_ID Product_Name Product_Price Product_Quantity Product_Picture
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.