473,395 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Get the latest record for each cust no.

Hi All,
My table appears like this with the following columns:

Name CUSTNo ORderNo. AcctDate OrderDate OrderDescription

I would like to write a ms-sql query to return the records of each customer number with the latest OrderDate. One more thing, if the customer has two separate order numbers on the same date(provided its the latest date), the query should be able to pull up both the records. Thank You
Jul 27 '13 #1
1 1348
Rabbit
12,516 Expert Mod 8TB
Join it to an aggregate query that returns the max order date grouped by the customer number.
Jul 28 '13 #2

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

Similar topics

4
by: Henry | last post by:
Dear all, I am now designing a table for storing inventory of servers in a DB2 DB. However, I am new to SQL and would like to seek advice whether the design could work as expect with DB2 SQL. ...
3
by: John Davis | last post by:
I currently have a Table with these fields: Symbol; Price; Date with data that looks like this: IBM; 10; 10/15/2003 IBM; 11; 10/29/2003 GM; 20; 10/15/2003 F; 25; 9/15/2003
2
by: John Baker | last post by:
Hi: I have used this group a number of times simply because while the manuals for Access may show the technology, but most are really weak on how to apply it in special situations and the...
2
by: M.Stanley | last post by:
Hi, I have a problem..I'm doing a specific query where I'm joining fields from a table with appednded data (there are duplicate records, except for the date/time), and another query. I want the...
5
by: alanspamenglefield | last post by:
Hello group, I have an SQL statement which pulls data from a table as follows: " SELECT tblSites.sites_siteno, " & _ " tblSites.sites_sitename, " & _ " Sum(tblStockResults.stkr_result) AS...
3
by: Verticon:: | last post by:
I have a table that has records layed out as so: Table: fd_Id INT IDENTITY (1, 1) fd_User VARCHAR(30) fd_Effective DATETIME Data could be as follows: 1 | "user1" | 6/20/2001 2 | "user2" |...
1
by: acdevteam | last post by:
Hi All, I need some help with a query. Here is the structure for the table: ID, sDate, sComment, sRole Possible values in the table: 0101, 11/6/2006, Comment123, Role1 0101, 11/6/2006,...
2
by: tbprimail | last post by:
I am trying to find a way to pull up only the latest record in a Query or other means. For example, a Table contains Car Owner, Type of Car, and Date of Last Service. I want to be able to pull up the...
1
by: mccax | last post by:
Hello, I have the following table (UNIQUOTE) with data in it: Opportunity_Id Rx_Combo Plan_Type B6FG3JX5G $27/$48/$28 HMO B6FG3JX5G $88/$33/$99 HMO B6FG3JX5G $16/$17/$18 HMO There is a...
0
by: Guido Konsolke | last post by:
"JN" <jirinej@volny.czschrieb im Newsbeitrag news:7e29a94a.0307090205.179bca49@posting.google.com... all Firstl of all: it's not too smart posting your question without enough infos. At least...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.