Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

QUERY FOR LASTEST OPERATION

 
   Database Help (Home) -> MS Access RSS
Next:  Informix Roundup: 31 December 2009  
Author Message
ZigZagZak

External


Since: Aug 18, 2008
Posts: 4



(Msg. 1) Posted: Wed Dec 31, 2008 3:22 pm
Post subject: QUERY FOR LASTEST OPERATION
Archived from groups: microsoft>public>access (more info?)

Hi I have a database that tracks where parts are in our shop. I have a table
that we enter where a part was put and it gets taged with the date. I am
trying to make a query to find the latest [date]/[location] for a
[OrderNumber]/[LineItem].

Can anyone help me set up this query?

The plan is to make a report showing department load. I already have a
query finding the average parts through a department. Now I just need how
many are currently in it.

Thanks in advance.

Zach

 >> Stay informed about: QUERY FOR LASTEST OPERATION 
Back to top
Login to vote
nonsense

External


Since: Nov 04, 2004
Posts: 742



(Msg. 2) Posted: Wed Dec 31, 2008 3:28 pm
Post subject: Re: QUERY FOR LASTEST OPERATION [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Create a new query in design view.

Add the table, add the "partnumber" field, add the date-tagged field.

Click the Totals button ("sigma", looks like a sideways "M").

Use "GroupBy on the "partnumber" field, and "Maximum" on the date-tagged
field.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP


"ZigZagZak" wrote in message

> Hi I have a database that tracks where parts are in our shop. I have a
> table
> that we enter where a part was put and it gets taged with the date. I am
> trying to make a query to find the latest [date]/[location] for a
> [OrderNumber]/[LineItem].
>
> Can anyone help me set up this query?
>
> The plan is to make a report showing department load. I already have a
> query finding the average parts through a department. Now I just need how
> many are currently in it.
>
> Thanks in advance.
>
> Zach

 >> Stay informed about: QUERY FOR LASTEST OPERATION 
Back to top
Login to vote
Ken Sheridan

External


Since: Jan 10, 2008
Posts: 651



(Msg. 3) Posted: Thu Jan 01, 2009 10:20 am
Post subject: RE: QUERY FOR LASTEST OPERATION [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Zach:

To return both the location and the latest date per OrderNumber/LineItem
you'll need to use a subquery to find the latest date and use this date to
restrict the outer query, e.g.

SELECT *
FROM [YourTable] AS T1
WHERE [date] =
(SELECT MAX([date])
FROM [YourTable] AS T2
WHERE T2.[ordernumber] = T1.[ordernumber]
AND T2.[lineitem] = T1.[lineitem]);

The aliases T1 and T2 are used to distinguish the two instances of the
table, enabling the subquery to be correlated with the outerquery.

BTW I'd avoid using date as a column name. It’s the name of a built in
function, so its better to use something specific like transactiondate. If
you do use date then be sure to wrap it in square brackets, [date], when
referencing the column in a query or in code.

Ken Sheridan
Stafford, England

"ZigZagZak" wrote:

> Hi I have a database that tracks where parts are in our shop. I have a table
> that we enter where a part was put and it gets taged with the date. I am
> trying to make a query to find the latest [date]/[location] for a
> [OrderNumber]/[LineItem].
>
> Can anyone help me set up this query?
>
> The plan is to make a report showing department load. I already have a
> query finding the average parts through a department. Now I just need how
> many are currently in it.
>
> Thanks in advance.
>
> Zach
 >> Stay informed about: QUERY FOR LASTEST OPERATION 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Operation must use an updateable query ! - Hi, I've got a problem with my Microsoft Access FrontEnd. It's linked to many excel spreadsheets and to an Sql Server 2005 Database. My Update query try to update the Sql Server 2005 Table with data stored in the linked spreadsheets. It used to work whe...

OPERATION MUST USE AN UPDATEABLE QUERY - INSERT INTO [Excel 8.0;].[Report$] ( Fixed, Unfixed, Total ) IN 'C:\Documents and Settings\Administrator\Desktop\test.xls'[Excel 8.0;] SELECT preb_count1.Fixed, preb_count1.Fixed, preb_count1.Fixed FROM preb_count1; Can you pls help me what's wrong..

Operation must use an updateable query - Consider the following Query in a MS-Access database: UPDATE FirstGlobal SET Quantity = (SELECT Quantity FROM FirstGlobal WHERE ClientName = [ClientName1] AND Scrip = [Scrip1] AND ContNoteNo = [ContNoteNo1]) + [AddQty1] WHERE ClientName=[ClientName1]....

3219 Invalid Operation - running an update query - Hi I have set up an update query with 4 parameters using CreateQueryDef: "qryUpdSalesMandate". When I try an run it using the following code: - Dim db As Database, qd As QueryDef, rs As Recordset Set db = CurrentDb Set qd =..

operation - hi yvonne my email address is sultanapowell@bt.internet.com im going for operation on 1/may/2008 (cleft palete) thanks. from tana
   Database Help (Home) -> MS Access All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]