473,395 Members | 1,653 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.

Need Help with nasty query

I have a table that stores user id and what date they where checked in
last.

Driver_ID Date
12 1/31/2006
12 1/16/2006
12 1/12/2006
24 1/31/2006
24 1/16/2006
24 1/12/2006

I'm trying to make a query that will give me a unique Driver_ID and
show the most recent date that from the table.

Driver_ID Date
12 1/31/2006
24 1/31/2006

I know that I'm going to need to have a sub-query to make this work. Up
to this point though I've onle been able to get it to show just one
record. Any ideas how to make this work.

Feb 1 '06 #1
2 1123

Try

select driver_id, max([date])
from tablename
group by driver_id

You really shouldn't use date as the column name

Mark
On 31 Jan 2006 17:16:08 -0800, "Bill" <wl*********@gmail.com> wrote:
I have a table that stores user id and what date they where checked in
last.

Driver_ID Date
12 1/31/2006
12 1/16/2006
12 1/12/2006
24 1/31/2006
24 1/16/2006
24 1/12/2006

I'm trying to make a query that will give me a unique Driver_ID and
show the most recent date that from the table.

Driver_ID Date
12 1/31/2006
24 1/31/2006

I know that I'm going to need to have a sub-query to make this work. Up
to this point though I've onle been able to get it to show just one
record. Any ideas how to make this work.

Feb 1 '06 #2
Thanks. That looks to have taken care of the problem.

Feb 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Rich May | last post by:
Afternoon all, Apologies for cross-posting but as my query covers both Access and SQL Server I thought I'd send it both! I have inherited a project to migrate a fairly complex series of...
48
by: Zenobia | last post by:
Recently I was editing a document in GoLive 6. I like GoLive because it has some nice features such as: * rewrite source code * check syntax * global search & replace (through several files at...
2
by: Mike Button | last post by:
Hello all, I am really really desperate on what I should do, and I am asking for help from anyone in this newsgroup, here's the situation: I am creating a form that is being run on a server...
5
by: cmc_dermo | last post by:
I have a form that has a select list. A user chooses a value and the page refreshes showing the selected value in the dropdown box. So I want to use Javascript to get the selected query from...
7
by: jcochran | last post by:
What would be the correct way of writing a sql select state with where clause while also using IF ELSE. I am using T-SQL and I cannot get it to work. I probably have the syntax wrong. I want to...
1
by: james | last post by:
I am creating an connection string at runtime using decryption (crypto libraries). i have a very unpridictable error while assinging the generated connection string to the connection property. ...
7
by: Monty | last post by:
Something odd is happening. Scripts on several sites that collect form data, save it to a DB, then redirect the user to another page are slowing to a crawl during the redirect using the header()...
9
by: Susan Bricker | last post by:
Greetings. My disclaimer first - I am a neophyte where VB and ACCESS are concerned, but I have been programming for quite a long time. That said ... I created a db at work using MS/ACCESS 2000...
51
by: cool_ratikagupta | last post by:
hello friends i ha just started learning c can u all give me the tips to make myself strong in c lanuage . as i want to be the best in watever i do . so just a request from all of u here plz help...
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
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...

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.