Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Sort on Month Name (Text Data Type)

    I am looking for some assistance. My data is pulled from excel and brings in the "month" as the word January, February, March etc as text data type. I need to sort on this field but being text it doesn't work. How can I either turn this into a date or perhaps convert the words to a number for sorting purposes.

    Hope that makes sense??

    Thanks in advance

    Kerry
    Last edited by kerryg; 2016-02-11 at 08:51.

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 985 Times in 915 Posts
    Two things I can think of.
    Import the data as a number and convert when it's displayed.
    Add a field "MonthNo" that matches the month field, retrieve that along with the data and sort on it but do not display it. You can populate the field when you import the data.

    cheers, Paul

  3. The Following User Says Thank You to Paul T For This Useful Post:

    kerryg (2016-02-11)

  4. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts
    Or, there is this. Let's suppose your fieldname is "MonthName". You could sort by this expression:

    Month( [MonthName] & " 1")
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. The Following User Says Thank You to MarkLiquorman For This Useful Post:

    kerryg (2016-02-11)

Posting Permissions

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