I have another table with (no id), shipnumber, name of ship, date of
activation ship
Example : 123456 , APOLLO , 01-01-2003
222222 , ZEUS , 01-02-2003
333333 , DIANE 2, 06-06-2003
123456 , MONTOYE V , 06-02-2004
I would like a query that shows me every ship number once and every
ship name once based on the latest date. So in case of 123456 that
would be Montoye V.
But i don't find it.
TX anyone, anywhere, anyway, anyhow, anytime. 3 1454
SELECT ShipNumber, ShipName, Max([DateField]) AS LastDate FROM TableName
GROUP BY ShipNumber, ShipName
--
Brendan Reynolds
"Peter D" <da*********@pandora.be> wrote in message
news:2f*************************@posting.google.co m... I have another table with (no id), shipnumber, name of ship, date of activation ship
Example : 123456 , APOLLO , 01-01-2003 222222 , ZEUS , 01-02-2003 333333 , DIANE 2, 06-06-2003 123456 , MONTOYE V , 06-02-2004
I would like a query that shows me every ship number once and every ship name once based on the latest date. So in case of 123456 that would be Montoye V. But i don't find it.
TX anyone, anywhere, anyway, anyhow, anytime.
Turn on Totals, Set group by on all fields except Date, for this one use
Max. Should return the most recent date for each record "group".
Mike Storr www.veraccess.com
"Peter D" <da*********@pandora.be> wrote in message
news:2f*************************@posting.google.co m... I have another table with (no id), shipnumber, name of ship, date of activation ship
Example : 123456 , APOLLO , 01-01-2003 222222 , ZEUS , 01-02-2003 333333 , DIANE 2, 06-06-2003 123456 , MONTOYE V , 06-02-2004
I would like a query that shows me every ship number once and every ship name once based on the latest date. So in case of 123456 that would be Montoye V. But i don't find it.
TX anyone, anywhere, anyway, anyhow, anytime.
try this,
You will need to query's:
Query 1:
SELECT ur_table_name.shipnumber, Max(ur_table_name.[date of activation
ship]) AS [date of activation ship]
FROM ur_table_name
GROUP BY ur_table_name.shipnumber;
Query 2:
SELECT Query1.shipnumber, ur_table_name.[name of ship], Query1.[date of
activation ship]
FROM ur_table_name INNER JOIN Query1 ON (ur_table_name.[date of activation
ship] = Query1.[date of activation ship]) AND (ur_table_name.shipnumber =
Query1.shipnumber);
Mark
"Peter D" <da*********@pandora.be> wrote in message
news:2f*************************@posting.google.co m...
I have another table with (no id), shipnumber, name of ship, date of
activation ship
Example : 123456 , APOLLO , 01-01-2003
222222 , ZEUS , 01-02-2003
333333 , DIANE 2, 06-06-2003
123456 , MONTOYE V , 06-02-2004
I would like a query that shows me every ship number once and every
ship name once based on the latest date. So in case of 123456 that
would be Montoye V.
But i don't find it.
TX anyone, anywhere, anyway, anyhow, anytime. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: shank |
last post by:
How do you return the highest value in a recordset of maybe 100 records?
Is it necessary to run 2 recordsets?
I was hoping it was as simple as Max(), but no luck.
thanks
|
by: Robert Oschler |
last post by:
I have a MySQL table on my web server (external web host) that has an
auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the table,...
|
by: Dirtyweeker |
last post by:
Hi,
I have a database which records fitness test results of pupils.
There are the usual name fields and then a series of fields holding results,
e.g. field BP1 and field BP2; each of these...
|
by: Jaspreet |
last post by:
I was working on some database application and had this small task of
getting the second highes marks in a class. I was able to do that using
subqueries.
Just thinking what is a good way of...
|
by: johnk |
last post by:
I have a table of items, with revision numbers. I need to extract the
items with highest revision number. The items may be listed several
times and I don't know what the highest revision number...
|
by: tess |
last post by:
What I need is to find out brand preference per customer. I have
records showing how many of each brand they have purchased in the last
5 years. I can easily create a crosstab query that will...
|
by: Dixie |
last post by:
I want to append a number of records onto an existing table. Each record
will have an ID number (it is not an autonumber as it is too variable). It
is currently set as an integer field. I want...
|
by: Coll |
last post by:
Hi - I'm trying to figure out how to append a record to a table and
then open a form and display that record. My thought was to use the
autonum primary key field (recordnum) and display the highest...
|
by: markcash |
last post by:
I have a web application where I am displaying the current inmate
population for the county jail. Part of the information that I
display is the mugshot. Unfortunately, they have changed the way...
|
by: daniel aristidou |
last post by:
I have a database i use to file. when i insert a new record i want it to imediately insert the next value (file number).the problem is the value is acording to subject. eg
Subject1 has a record...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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: 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: 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...
|
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...
|
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,...
| |