473,653 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to sort oldest dates

1 New Member
hey everyone,
i am having trouble with getting this to work, i have an inventory table with part number, description, qty, location where it stocked and date it came in, and how much has shipped, and a couple of other things, i have successful made a query that tells me when a primary location is low on stock, but i would like to make a query that will then look thru the other locations that same part is in and return the oldest date or the oldest 2 dates, so i know where to go and get the new product and refill the location. it does not sound hard but i have not been able to get it.
Jun 29 '10 #1
4 1888
jimatqsi
1,276 Recognized Expert Top Contributor
Why not sort by the stock date, so the first row is the row you want? Oh, wait, the post title indicates you already thought of that ... there is a sorting option on the query builder. You can choose ascending or descending. But you probably tried that already ... what was the result of that?

Jim
Jun 30 '10 #2
NeoPa
32,568 Recognized Expert Moderator MVP
It sounds like you want a linked subquery (See Subqueries in SQL) which uses the TOP predicate and sorts ascending by date.

It's hard to be precise without more info related to the table you wish to search.

Welcome to Bytes!
Jun 30 '10 #3
jimatqsi
1,276 Recognized Expert Top Contributor
I didn't know about subqueries! 10 years in Access and I didn't know about them. Thank you Ade, thank you Bytes.com!

Jim
Jun 30 '10 #4
NeoPa
32,568 Recognized Expert Moderator MVP
Well, I must say I'm very pleased to have been an instrument of enlightenment :) Good for you Jim.
Jun 30 '10 #5

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

Similar topics

8
5327
by: Riley | last post by:
The date fields being saved by a VB program were being saved as #2003-11-22#. For reasons unknown to me these dates began to be saved as "11/22/2003" All of these dates were made dates with the "DateValue" instruction and when used as input to Excel both formats sort as dates but not intermingled. All "11/22/2003" formated dates sort in date order but before the #2003/11/22#. What would cause the format of these dates to change and what...
10
3282
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: http://www.ipwebdesign.net/kaelisSpace/useful_tableSort.html This works great except it doesn't sort my UK formatted dates properly, and I end up with something like this: Birth Date (dd/mm/yyyy)
6
1331
by: Sam | last post by:
Hi, In SQL Server when I create a stored procedure, in the list of stored procedures the Create Date column used to be formatted as: 28/09/2004 14:35:24 But since yesterday, for some reason, when a new stored procedure is created, the date appear as : 2005-05-31 14:03:07.854 Why??!? This is very annoying to sort my procedures by date as it messes up everything..
4
4475
by: P Adhia | last post by:
Hello, If the explain shows that DB2 needs to sort the result of a cursor, does that always happen? i.e. if the resultset of the cursor is empty, does the sort have any overhead? It appears that, majority of the time is spent in allocation and deallocation of the temporary file to hold the data for the sort. Do these activities still take place for an empty cursor? Also, DB2 manual appears to say that only RID sorts are done in
8
7564
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I want them to do as little as possible when they run their reports. I have a crosstab query that displays usage of items for each month. It looks pretty much like this: ITEM DESC UM 12/02 1/03 2/03 3/03 ...ETC. 1 Solution ...
1
3183
by: totoringo2004 | last post by:
Hello, I’d need some help guys... I know how to do it in Excel, but can’t find a way in Access... here’s a simplified overview of the problem: Let’s say I have Invoices as follows: Jan-04 $110 Mar-04 $100 May-04 $130
2
1653
by: mpmason14 | last post by:
i am trying to sort a report by the year from newest to oldest. however there is a catch... the format of the records i want to sort by is YYMMDD - i am trying to figure out how to get it sorted from the most current (2006) to the oldest (in the 80s). any ideas without having to recreate a new column manually? there are over 500 records, need i say more?
9
21099
by: georges the man | last post by:
how do i sort dates in c. i have dates in a file in the following format: dd/mm/yyyy ie 12 aug 2006 i want to sort the dates in the file in an assending way. how can i do this?
2
1444
ID94
by: ID94 | last post by:
I am in need of some helpwith two problems. 1. I'f got some dates in a array and want to sort them. Starting from the oldest to the newest. 2. Is there also a way to calculate todays date plus seven ie in a weeks time? Any help is greatly appreciated
3
3285
wordbrew
by: wordbrew | last post by:
I'm nearly done with a database but there is one more thing I would like to add. I would like to add add a combo box, let's say I call it , to my form , where the contents of the combo box are populated with the current year 2010, but also includes, say 5 years prior, and 5 years into the future. And when the current year becomes 2011, I would like it to auto calculated based on that, etc... (I know this will probably have to be done via...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8470
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8590
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.