Forms :: Date Sort Order - Newest To Oldest

Dec 17, 2013

I have a combobox (cbo_FileNames) that is unbound and gets fed on activate from a folder

Code:
Set SourceFolder = FSO.GetFolder("c:GundogManagerBackUp")

My problem is that the file names are as follows:

GundogManagerBackUp 02_12_13.xls
GundogManagerBackUp 03_12_13.xls
GundogManagerBackUp 07_08_13.xls
GundogManagerBackUp 16_11_13.xls
GundogManagerBackUp 17_12_13.xls

As you can see it consists of the name and a date of the backup. When it populates the combobox I want it to go in date order I newest to oldest. At the moment its going of the first number.

View Replies


ADVERTISEMENT

Displaying Oldest And Newest Date In Query?

Jul 28, 2015

I have Query which has dates in multiple columns. I need to know if there is a formula that will allow me to display the oldest date and the newest date?

Below is the output of my Query in Excel. I need the output to have two additional columns: Beginning Date and End Date. Based on the example below, I would need the beginning date to show 6/21 and the end date column to show 6/23 so when I export to excel, it shows these two dates. In Excel, there is a min/max formula that can do this but it looks like the min/max in Access only displays the min/max data? Unfortunately, creating this formula is not an option after the fact. Secondly, I need the word "DIRECTION" to show in it's own separate column in the in the query. I don't know if I can do this without adding another table to the Query or if I need can just add a column in design view and put something in the criteria that will do this.

I have included an example of my current output and what I need the output to read.

Current Output
Sunday
In
Out
Monday
In
Out
Tuesday
In
Out

[code]....

View 2 Replies View Related

Sort By Oldest Date First (records)

Nov 16, 2006

Hello All,

I currently have a form where I would like the form to display the oldest account first, so the overall objective is the employee will action the oldest account first and then go onto the next one etc.

Can anyone please tell me how to do this?

Thank You.

Mos

View 2 Replies View Related

Sort (order) Data On Forms

Apr 12, 2005

Hello,

This is related to "Old_value, new_value" thread I posted yestarday (Module&VBA).

I have a problem i missed yestarday. The code it's vorking great, but it allways takes the showed new_value and makes it old_value for the new record, and this is a problem, because the showed record is not the last for that customer.
So, I was thinking that if I make a new Autonumber field in my table, I could sort descending the values and this way the input form will allways show me the last entered data for that person.
As I noticed from a long time ago, if I sort a table that allready has a form, the form won't show the records sorted. Why? It's necessary to make the form again? I tried to order the data on the form from Properties window ->Data->Order by, but the ordering is Ascending and I need it Descending!
Can enybody help me?

Thanx,
Attila

View 1 Replies View Related

Forms :: Custom Sort Order In Subform

Apr 28, 2015

I have a subform with year and month, subform shows result of a select query.

When I open query separately it show data as required order but when i show data in subform related to this query, data show in rearrange order.

How can I set order in subform as query result.

View 3 Replies View Related

Forms :: Setting Sort Order On A Form With Multiple Subforms

Mar 4, 2014

I have a tabbed form. The main form is titles ContractDtlsFRM. There are 3 other subforms in separate tabs. The first field in the ContractDtlsFRM is Contract No. I would like the form to sort in ascending order by this number.

I tried entering the following code in the Forms Order By event but it didn't work

Private Sub Form_Open(Cancel As Integer)
Me.OrderByOn = True
Me.OrderBy = [Contract No]
End Sub

View 2 Replies View Related

Subtract Sales From Stock With Oldest Date First And Then Move To Next Date?

Sep 16, 2014

Table 1 has all the items I am trying to sell with sell by date after which I cannot sell this item. Then in Table 2 I have forecasted sales. So now I am trying to calculate stock consumption to see if I will be left with any stock that I cannot sell.

So now somehow I need to deduct sales forecast from my stock holding but it needs to go by date i.e. consume all stock for Item 1 with date 16/09 before moving to Item 1 with sale by date 23/09.

So based on the attached example, I can see that on 16/09 I will consume only 5 cases from sell by date 16/09 and another sale is 18/09. So that would give me information that I will be left with 95 items dated 16/09, which I cannot sell because they will be out of date.

I would like also to include the logic that if Item is out of date it would move to the next sell by date.

So in this case sale of Item 1 forecasted for 18/09 (94) would consume the whole stock (50) with date 23/09 and another 44 from date 01/10.

For Item 2 I can see that units with Sell by date 30/09 will be consumed on 25/09 and I will start taking stock from next sell by date which is 14/10.

View 2 Replies View Related

Only Pull The Newest Date From A Table

Jun 23, 2005

I have a crosstab query that I ONLY need the newest date from the table I'm pulling from reguardless of what it is for. Here is what I have:

TRANSFORM Max([Cust Count].[Active Customers]) AS [MaxOfActive Customers]
SELECT [Cust Count].Node, Sum([Cust Count].[Active Customers]) AS [Total Of Active Customers]
FROM [Cust Count]
WHERE ((([Cust Count].Services) In ("core","data","telephone")) AND (([Cust Count].ASC)="uh") AND (([Cust Count].Date)=#6/12/2005#))
GROUP BY [Cust Count].Node, [Cust Count].Date
ORDER BY [Cust Count].Node
PIVOT [Cust Count].Services;

I know this is only setup to get items from 6/12/05 but more will be added to the table and I only want the new info for this query. Thank you.

View 11 Replies View Related

Flagging Newest Date Within A Month

Mar 13, 2006

I am a relatively new to some of the more advanced features of Access. Here is my problem:

I have a table that will be linked to a graph. Each record is for a particular date. There can be multiple dates within a month, but for each month I only want to display the most recent date within a given month. In other words, the graph will only display data from the last record in a given month.

My idea was to somehow flag the records that are the newest date within a month. However, I would also be open to running an append query to simply delete these records as the table is updated (though I would rather preserve the records and stick with the "flagging" option).

Any help would be much appreciated.

View 1 Replies View Related

Forms :: Use Buttons On A Form To Change Sort Order On A Continuous Form

Jul 23, 2013

I want to use buttons on a form to change the sort order on a continuous form. In the buttons click event I am using a public function (named Sort_1) to change the sort order. The first element of the event call is the name of a generic query (named Sort_1_Query1) and the query field to sort (LAST_NAME OR FRIST_NAME, depending on the button.)This is the Click Statement.

=Sort_1("Sort_1_Query1","LAST_NAME")

This is the Public Function
Public Function Sort_1(SortName As String, FieldName1 As String)
DoCmd.ApplyFilter SortName, FieldName1 & "between 'A' and 'Z'"
End Function

I think the problem is in the use of quotation marks or trying to pass the query field name to the Do Command or the use of an ampersand.

View 4 Replies View Related

Sort Order

Oct 10, 2005

How do you change a file's sort order from ascii to international?

View 3 Replies View Related

Problem With Sort Order

Feb 11, 2007

Hi all, I am new to this site and I am hoping that I might be able to get some help with my database which records address information of people reqesting a brochure or making a hotel booking. The problem that I am having is that the addresses are sorting in post code order, I have selected remove filter/sort and this does not do anything. I would like the records to stay in the order that they are entered at I also use this for a merge with a brochure/deposit letter and it is much simpler if I can merge a block of entries.

Many thanks in advance Pat.

View 6 Replies View Related

Dynamic Sort Order

Apr 18, 2007

Supposed I have the following tables:

TableMonthlyReport consists of the following fields:
*IDStore
*Year
*Month
*IDCatalog
*IDItem
Quantity

TableGoods:
*IDCatalog
*IDItem
ItemName
IDSupplier

The asterisks indicates the index keys. While TableMonthlyReport has 2 links of relationship with the TableGoods on IDCatalog and IDItem.

I have a data entry front end for monthly report. I have no problem to have the record source for this purpose.

I just need that the sort order of the item (in the front end) in a way that they could be managed differently on different period. For example, in March to April 2007 I want the items shown in the following order: A B C D ... While in May to August 2007 I want the items shown as B D A C ....

I tried to create an order table just like this:
TableGoodsOrder:
*IDCatalog
*IDItem
*ValidStart
ValidEnd
OrderItem

It is linked with the TableGoods on IDCatalog and IDItem.

The first order list (March - April 2007) will have the ValidStart of 703 and ValidEnd of 704. While the next order list will have the ValidStart of 705 and 708. The last 2 digits stand for the month, while the first digit is to indicate year.

The SQL query for the record source works but I can not enter any value. So, the idea of having a special table for sort order is not OK.

Can anybody give me a clue for the solution?

View 2 Replies View Related

Sort Order Problem

Dec 6, 2005

I have a table in MS Access with records including dates. The dates are date/time data type and formatted as short dates. They display properly in the table.

However, when I run a query (SQL shown below), it sorts the dates strangely.

Any ideas??

SELECT DISTINCTROW Format$(tblChat.dtDate,'Short Date') AS ChatDate, Sum(tblChat.TCT) AS SumOfTCT, Sum(tblChat.NC) AS SumOfNC
FROM tblChat
GROUP BY Format$(tblChat.dtDate,'Short Date')
ORDER BY Format$(tblChat.dtDate,'Short Date');

Here’s an example of the sort order in the query.

10/31/2005
11/1/2005
11/10/2005
11/11/2005
11/12/2005
11/14/2005
11/15/2005
11/16/2005
11/17/2005
11/18/2005
11/2/2005
11/21/2005
11/22/2005
11/23/2005

View 2 Replies View Related

Sort Order Question

Nov 3, 2006

Is there a way to sort dates using "Decending" but have blank dates stay on top?

I have a listbox based on a qurery that displays all pending and completed jobs. The query sorts (Ascending) the "Job Complete" date. This conveniently puts all of the pending jobs with null values at the top of the list. The bad part is that this puts recently completed jobs at the very bottom of a (thankfully) long list. Is there a way around this?
Thank you!

View 5 Replies View Related

Specific Sort Order

Mar 2, 2005

Okay, here's my new dilema. I'm in the military and rank is one of the fields in my DB. The only issue I'm having is that I would like to sort by seniority, not alphabetically. For Example, I've listed a few ranks below in the correct order from greatest to least. Is there some way that doesn't involve a page of code to achieve this? Thanks.

Colonel
Lt. Colonel
Major
Captain
1st Lt.
2nd Lt.

View 8 Replies View Related

Need Weird Sort Order

Mar 14, 2005

I have a query that fills a report that I have in an Access 2000 database. This report needs to be sorted by the following:

Code:ORDER BY tblPrimaryDept.PDName, tblSubDept.SDName, tblKeyStrategy.KSID, tblKeyInitiative.KIID, tblKeyDeliverable.KDID, tblSubDeliverable.TargetDate, tblQuarters.QID;

It's working fine, but .... (There's always a but)

tblKeyStrategy.KSID can be null, so therefore, it is sorted by null records, then ascending order tblKeyStrategy.KSID. What they client wants is it to be sorted by tblKeyStrategy.KSID first, then the null value ones.


ie:
So as it stands it currently does this:

Finance
Finance
Finance 1
Finance 2

Now they want it to do this:

Finance 1
Finance 2
Finance
Finance

Is there any way this can be done? I've been looking, but haven't seen anything regarding this.

Thanks for any assistance you can give me on this.

View 13 Replies View Related

Access Changes Sort Order On Paste

Mar 7, 2008

Hi all,

I'm quite new to access, and have a pretty straightforward problem (I hope):

I have a table with 300 records in 10 columns. I want to:
1. filter the data based on column A (gives me 150 visible records)
2. Copy from an excel spreadsheet which exactly matches the access table (single column only, 150 rows)
3. Paste into a new column I created in the access table

Unfortunately, when I hit paste in access, it loses the filter and pastes the data into the complete dataset (i.e. into the wrong records).

I've no idea why access won't keep the filter I set. I also tried numbering the records and sorting them based on this new column. Again, Access lost the sort order before pasting the data.

Help!

I really need to be able to paste my excel data into the table in access!

Can anyone shed some light for me?

Thanks in advance,

Lee

View 4 Replies View Related

Customize The Sort Order Of A Combo Box

Dec 7, 2005

i have a combo box on a payment form which shows existing permit #s. i'd like to make the sort order show the most recently added permit first. i clicked on the build button next to RowSource on the data tab of the properties of the combo box which opens the query my combo box is based on. there are only 3 sort order options...ascending, descending, & not sorted. can this be done?

the permits form has a button to open the payments form (payments can also be opened alone too - ie. if somone applies for a permit today but pays for it tomorrow...). usually this will not be the case but that is why i have to keep it either combo or list.

all help is appreciated.:)

View 3 Replies View Related

Sort Order Of Unbound List

Sep 15, 2006

I need to manage a list of, in this case "medications", with this list the most common "meds" are on the top of the list. there will be at times new "meds" added that should be at the top of the list. I want to create a unbound box that will let me drag the "meds" up or down in the list. The best emample i know of is the way you can set the "Tab" fields on a form to move the tabs stops.

View 4 Replies View Related

Change Sort Order On Form

Nov 29, 2004

How do I change the sort order to display on a form using an option button?

Thanks!

View 1 Replies View Related

Saving Sort Order In A Form

Apr 29, 2008

I am working with Access 2003 and want to save the sort order in a subform. The new sort order would be different from that of the underlying table. The Order By property has been set but isn't working the way I expected. I have tried replacing the underlying table with a query but that hasn't worked out either. I don't want to change the order of the table because other programs that access it would be affected.

I've been reading about an Order By On switch that might do the trick but apparently it's not contained in Access 2003. There must be some other way to skin this cat!

Thanks in advance.

View 4 Replies View Related

Queries :: Specific Sort Order

Sep 13, 2013

I have a query that is returning running conditions for a machine over multiple shifts. the table is set up like this

Code:
date shift parameter condition
09/13/13 1 front 500
09/13/13 1 middle 450
09/13/13 1 back 475
09/13/13 2 front 510
09/13/13 2 middle 460
09/13/13 2 back 490

this is just a small example. there are about 24 different parameters reported on in a shift..I want the query to sort by date ascending, shift ascending, and then by parameter in a specific custom that i define. I want it ordered "front, middle, back" for each shift. Again this is just an example, there would be 24 parameters I want in a specific order. Then do I need to define the sort order again for the report based on this query?

View 3 Replies View Related

Access Query Sort Order Every Other One

Sep 29, 2014

I am trying to create a work schedule, some customers are scheduled for morning and others in the afternoon. I am trying to figure out how to sort AMs and PMs so I get a line with every other one.

View 2 Replies View Related

Combo Box - Custom Sort Order

May 22, 2014

I have a combo box with the following entries:

Document
Other
Process
Validate
Verify

I want the list sorted so that "Other" is at the bottom. Everything else is alphabetical ascending. Is this possible?

View 4 Replies View Related

Sort Order With Null Values

Aug 22, 2012

I have a Form which presents the results from a query. Upon clicking the header of each column of data the records are sorted A-Z and Z-A using the code below. This works fine when all records have data in the relevant field but not when several records have a value of null. It appears that when null values are present the "If Me.OrderBy = "property" & " DESC"" always evaluates as not true, even though all the null values are on top and all the filled in values are in appropriate order.

A second issue is one of my fields is not sorting properly at all. I have two date fields, one sorts the other does not. The one that sorts is a user entered date (8/22/2012) which defaults to "9/9/9999" if the user does not enter a different value. The other date field which does not sort properly at all is a calculated date field which chooses the earlier of two possible dates (both associated with the same record) using

IIf([Senior Mortgage Maturity]>[Mezz Maturity],[Mezz Maturity],[Senior Mortgage Maturity])

This code is repeated for each of the six fields with the relevant field name in place of 'property'.

Private Sub Property_Label_DblClick(Cancel As Integer)
Me.OrderByOn = True
If Me.OrderBy Like "Property" Then
Me.OrderBy = "property" & " DESC"
Else
Me.OrderBy = "property"
End If
End Sub

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved