473,382 Members | 1,814 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,382 software developers and data experts.

Find last order date for each client

Drawn a blank.

Looking to find the last date each client ordered something.

The query should show each client and the last order date.

2 tables: Clients and orders. clientID in each.

Any hints/directions appreciated. Even blistering attacks on my ability.

Thanks,

Jef
Nov 20 '06 #1
3 3465
MMcCarthy
14,534 Expert Mod 8TB
Jef

We all have to start somewhere. The following query (using your field names of course) should do the job. This will return the clientID, name and last order date (assumes a valid date format for order date). Have a look and if there is anything you don't understand about how it works just ask.

Mary

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT Clients.ClientID, Clients.[ClientName], Max([OrderDate])
  3. FROM Clients INNER JOIN orders 
  4. ON Clients.ClientID=orders.ClientID
  5. GROUP BY Clients.ClientID, Clients.[ClientName];
  6.  
Nov 20 '06 #2
Thanks Mary. I'll try this today.

Just found The Scripts yesterday. Looks good.

Jef
Nov 20 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Thanks Mary. I'll try this today.

Just found The Scripts yesterday. Looks good.

Jef
Thanks Jef

We're trying to build a community that's friendly to users at all levels. So never be afraid to ask basic questions.

All the experts who volunteer expect is that you post your questions clearly, following the Posting Guidelines ...

http://www.thescripts.com/forum/thread559246.html

and repsond with the results you obtained from their suggestions along with any variations you try.

If you put some work in yourself and respond clearly you'll get a lot of help here.

So far you've done good. Keep it up.

Mary
Nov 20 '06 #4

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

Similar topics

2
by: PC | last post by:
Hi, I have used the DLast("!","")function to find and display the last entry in a table. How would I go about displaying the last record in a table that is not Null? Thanks in advance ...pc
1
by: Erik Schweitzer | last post by:
I work for a tool & die shop, and we have an Access DB that captures work performed on each job we do. Each job could have 5 or more entries for work performed on it. I am trying to create a...
13
by: Sue | last post by:
I'm working on a database that keeps track of employees hired by a general contractor on a project by project basis. These employees are hired to work on a project and are then laid off either at...
1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
2
by: Neo Geshel | last post by:
I need to get the ClientID of a form field for some JavaScript. About 25+ web sites I visited recommend the following method for finding the client ID of a web form: Web Form -> <asp:TextBox...
17
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
16
by: Otie | last post by:
Hi, Is there a way for VB5 to determine exactly where on a hard drive a .exe file is stored upon the .exe file's first copying to the hard drive? What I need to know is the exact hard drive...
9
by: ice | last post by:
Hello, I have a couple of tables. The client tables and the contacted tables. I am not sure how to start on this, what I need is a way to query all my clients then show any client that the...
3
by: paii, Ron | last post by:
I have a sales table that logs sales information for each active job at the end of each month. My question is, will the following query give me the last sell price for each job in the sales table?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...

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.