filter data using a query

109bow

Registered User.
Local time
Today, 10:45
Joined
Oct 24, 2007
Messages
141
Hi all, I have a query that I need to filter results from 2 fields. I have one field that filters data of 1,2,3 or 4 to return a 1. but I need to filter that further to return the last entry by date. I have used DMax("[date]","09ts data") in the date field, but the query returns empty fields.
Is there a way of doing this in one query or do I need two separate queries.
I have no experience of VB, so I don't know how to do it that way.
Thanks
 
Could you demonstrate your issue with data please? Provide 2 sets:

A. Starting sample data from your table(s). Include table and field names and enough sample data to cover all cases.

B. Expected results of A. When you feed the query the data in A, what do you expect it to return.

You could upload a spreadsheet with 2 tabs on it, or use this format for posting straight to the page:

TableNameHere
Field1Name, Field2Name, Field3Name
Sally, 13, 2/1/2016
Dave, 45, 3/3/2016
Tim, 33, 2/2/2016
 
attached is an excel spreadsheet with a sample of the data I use. below is the data filtered down to even number and axle position, I need to filter further to the last date for the specific data.
Thanks
 

Attachments

1. You didn't provide table names.

2. You either didn't provide me B, or you didn't provide valid B.

Is the bottom section of data the data you want the final query to return? If so, its impossible to end up with a date of 3-Aug-15, because the top data does not contain that date.

Again, I need 2 sets of clearly labeled data:

A. Starting sample data from your table(s). Include table and field names and enough sample data to cover all cases.

B. Expected results of A. When you feed the query the data in A, what do you expect it to return.
 
find attached another spreadsheet. Hope this helps some. Unfortunately my access file is 16Mb and source excel file is 6Mb otherwise I would upload them
 

Attachments

Again, B is not produceable from A.

1. You have 1725 records in A, but you only want your query to return 1 record from all of that? What criteria makes that 1 record out of the 1725 be returned?

2. Column H of your expected results is the value 'Planned Turn'. No where in A does the value 'Planned Turn' exists. There is no way to return that value in the results if it doesn't appear in the input.

Your data doesn't jive. There is no way to produce B from the A you have given me.
 
I appreciate you patience. I have a query "all turn data" that adds the turn description, column H.
what I need from the second tab is the serial number so I can add it to a report, see attachment, 3rd tab, the unit number is taken from another query and is selected using a combo box on the front page form
 

Attachments

Last chance.

A. Starting sample data from your table(s). Include table and field names and enough sample data to cover all cases.

B. Expected results of A. When you feed the query the data in A, what do you expect it to return.
 
plog, as you can gather I'm not that familiar with access. but in the hope someone can help, I attach an updated spreadsheet. the result of the required query I would expect to be row 2 on 3rd tab.
If I've pushed your patience too far I understand.
Thanks, Ben
 

Attachments

Users who are viewing this thread

Back
Top Bottom