+ Reply to Thread
Results 1 to 4 of 4

Months showing in wrong order

  1. #1
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    55

    Months showing in wrong order

    I have an SQL connection to feed a pivottable.

    SELECT *, datename(month, MLatestDueDate) as Month1, YEAR(MLatestDueDate) as Year1, DATEPART(wk, MLatestDueDate) as Wk1
    FROM "dbo"."tblPurchOutsFamily_TMP"
    ORDER BY YEAR(MLatestDueDate), datename(month, MLatestDueDate), DATEPART(wk, MLatestDueDate)
    The result shows 2017 March before 2017 February and I can't find why. The primary index of the table is the purchase order number and line number. The dates are from November 2016 to March 2017. The numbers below the month names are the week numbers.

    What can cause this?
    Attached Images Attached Images

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

    Re: Months showing in wrong order

    Should it not be?

    Please Login or Register  to view this content.
    If someone has helped you then please add to their Reputation

  3. #3
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    55

    Re: Months showing in wrong order

    Can you be more explicit?

  4. #4
    Registered User
    Join Date
    08-22-2016
    Location
    MTL, CA
    MS-Off Ver
    2013
    Posts
    55

    Re: Months showing in wrong order

    I solved the issue by creating a SQL function that formats the date as a 2-digit month number + the month name (01 - January... 12 - December).

+ 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. Graph not showing months ?
    By dougers1 in forum Excel General
    Replies: 1
    Last Post: 11-01-2015, 07:06 AM
  2. [SOLVED] Total SUM Value - Showing the wrong value
    By RhoniMohanraj in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-05-2013, 01:23 AM
  3. Replies: 4
    Last Post: 01-01-2013, 05:00 PM
  4. Wrong months in a year
    By excelpert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-18-2012, 11:18 AM
  5. Excel 2007 : Showing negative months
    By hpasso217 in forum Excel General
    Replies: 1
    Last Post: 03-04-2011, 06:20 PM
  6. Wrong Sum() Showing
    By ChrissyHof in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-28-2007, 02:17 PM
  7. SUMPRODUCT is showing wrong Amount
    By msbutton27 in forum Excel General
    Replies: 2
    Last Post: 01-25-2006, 11:45 AM

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