+ Reply to Thread
Results 1 to 16 of 16

Dates To show blank FIRST then rest of dates in Descending order

  1. #1
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Smile Dates To show blank FIRST then rest of dates in Descending order

    Hi I an creating a database with expiry dates in one column which the record will be sorted by. Currently I have the dates in descending order an example is shown below :
    31/09/2019
    27/06/2016
    21/06/2016
    21/05/2014
    00/00/0000
    00/00/0000
    (the last two will show as empty cells because they have no expiry dates)

    I would like the order as above but with the empty/blank cells at the top

    I have conditional formatted them according to dates (green if no expiry or still in date within x amount of days , amber if running out within x amount of days, red if out of date ETC)

    I have looked online and played about with vba but I still have no clue

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Dates To show blank FIRST then rest of dates in Descending order

    Hello welcome to the forum.
    As you have the various cells conditionally formatted, you can sort the column by cell colour with Green on top if these are the values with zero. Look under the Home tab Custom Sort/Filter for the various options.

    Hope this helps.
    DBY

  3. #3
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Re: Dates To show blank FIRST then rest of dates in Descending order

    Hi DBY

    if I can do it by conditional formatting that would be great but I am not sure where I can do this on the sort options


    any ideas??

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Dates To show blank FIRST then rest of dates in Descending order

    See the attached screenshots. If you're using Excel 2010 then you should find these options.

    Sort Options.jpg


    Sort Options 2.jpg

  5. #5
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Re: Dates To show blank FIRST then rest of dates in Descending order

    I'm using access 2010 not excel for my database.....

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Dates To show blank FIRST then rest of dates in Descending order

    I'm so sorry. I didn't notice you were referring to Access. I'll have a look at that to see if I can find a solution. I'll get back if I find anything.

  7. #7
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Re: Dates To show blank FIRST then rest of dates in Descending order

    Thank you so much!!

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Dates To show blank FIRST then rest of dates in Descending order

    The records holding the 00/00/0000. Do those records look like that or do they look empty/null? A little confused by your explanation as to what they look like in your DB.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  9. #9
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Re: Dates To show blank FIRST then rest of dates in Descending order

    this is an example to what they look like


    Untitled.png

    if it doesn't show they come up as null values

  10. #10
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Dates To show blank FIRST then rest of dates in Descending order

    Hello
    I think it's possible to create a Query with a calculated field which will sort by Null values first and then Descending for the Expiry Date. For example the Calculated field would contain:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The 1000000 figure being an arbitary number greater than your maximum date.

    Query design:

    Query Design.jpg

  11. #11
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Re: Dates To show blank FIRST then rest of dates in Descending order

    I am trying this but it seems I am unable to, is this because the data I am dealing with is in a subform on another form?

  12. #12
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Dates To show blank FIRST then rest of dates in Descending order

    Hi
    It could be. Can you not run the query off the original Data Table rather than the sub form?

  13. #13
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Unhappy Re: Dates To show blank FIRST then rest of dates in Descending order

    I have tried to complete the query and it has just made lots of errors to my subform from the query/original table is there any other way???

  14. #14
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Dates To show blank FIRST then rest of dates in Descending order

    Sorry at the moment I can't think of another way to do this. Using your sample data it works for me in both Queries and Forms. Not sure why it messed up your Sub Form/Table, the query shouldn't have changed your original Table, just merely sorted it differently on the Query datasheet view.

  15. #15
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Dates To show blank FIRST then rest of dates in Descending order

    If theyre NULL fields (which they should be in Access) then you could just sort by length of date and then date ie
    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  16. #16
    Registered User
    Join Date
    10-13-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    11

    Re: Dates To show blank FIRST then rest of dates in Descending order

    hi! thank you for trying with this problem I have now changed they way I have set out my form and filtered to appropriate things to make it easier for everyone! Thank you again

    I have a new problem (typical )

    which if anyone cant help with can be found from the link below.

    http://www.excelforum.com/access-tab...ml#post4220546

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I not show blank dates on chart
    By Wskip49 in forum Excel General
    Replies: 2
    Last Post: 05-16-2015, 08:33 AM
  2. [SOLVED] Concatenate if other column value is non-blank or non-zero BUT IN DESCENDING ORDER
    By Petros Georgilas in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-08-2014, 04:26 PM
  3. Replies: 3
    Last Post: 04-17-2014, 09:50 PM
  4. [SOLVED] Sort by descending order, but the blank spaces come on top
    By billj in forum Excel General
    Replies: 3
    Last Post: 07-18-2013, 04:18 PM
  5. Sorting in descending order and show duplicate values
    By cceze in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-19-2012, 09:33 AM
  6. Pivot table to show certain column in descending order
    By rushdenx1 in forum Excel General
    Replies: 1
    Last Post: 01-04-2012, 05:32 AM
  7. Lookup function and dates in descending order
    By snowy08 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-10-2010, 03:20 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1