I have an SQL connection to feed a pivottable.
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.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)
What can cause this?
Bookmarks