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

Question on selecting dates in a query

1
I am an infrequent user and my version is Access 2000. I have a list of 122k lines which consits of 3 fields/data points;a product code, a date, and a price code. I want to run a query to select the latest date the product code was entered and return the price code associated with the date. There are entrys for many different dates, none of them are the same. I have pulled all the data into access but can not figure out how to get just the latest or greatest date with its associated code.
Nov 22 '06 #1
1 2254
MMcCarthy
14,534 Expert Mod 8TB
I am an infrequent user and my version is Access 2000. I have a list of 122k lines which consits of 3 fields/data points;a product code, a date, and a price code. I want to run a query to select the latest date the product code was entered and return the price code associated with the date. There are entrys for many different dates, none of them are the same. I have pulled all the data into access but can not figure out how to get just the latest or greatest date with its associated code.
this should do it ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT [Product code], Max([Date]) As LatestDate, DLookup("[Price code]", "TableName", "[Date]=" & LatestDate & " And [Product code]=" & [Product code]) As PriceCode
  3. FROM TableName
  4. GROUP BY [Product code];
  5.  
Nov 23 '06 #2

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

Similar topics

1
by: Mark | last post by:
Hi - I have a numebr of rooms, which I am making available. table: single - has single_id and single_name rental_single has rental_id, single_id, check_in and check_out They are linked by...
3
by: Dino | last post by:
I am creating a website that is going to ask the user to enter a date! then from an access database get all records where a date field is greater then the date entered! Sounds simple, I do it in...
8
by: DH | last post by:
Say I have a table with two columns that matter to this example, and . And here is an example of what the rows currently look like: , 1,6/27/2001 1,6/27/2001 1,5/31/2001 2,6/27/2001...
2
by: Catherine | last post by:
I have a database where in my query I need to be able to locate accounts that show a date greater than 14 days from the current date. How would I structure this to allow for all accounts that over...
1
by: Mike Cooper | last post by:
Hi everyone, This is a tough one. I have a database full of solicitations, identifying a customer and recording initial call, first followup, second followup, etc. My boss want to be able to...
1
by: DougS | last post by:
Is it possible to highlight more than one date in the calendar control? I'm trying to display a calendar to the user and highlight the dates that have action items. Is this possible? Or is this...
1
by: vunderusaf | last post by:
I have a listbox on a form that is selecting using named FinalQuery: SELECT ., ., . FROM FinalQuery; Now I have a text field with a date on this form and I'd like to use that date as the...
4
by: Good Man | last post by:
Hi there I have a list of jobs scheduled in a MySQL table, with start dates and end dates, like so: SchedID | JobID | StartDate | EndDate |...
4
by: rekhasc | last post by:
hi friends.. i am using sql server 2005 reporting services.. in database the table contains startdate row and enddate row... i want the query which display all the contents between these...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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.