I have the following query in which I am trying to order dates in British format using SQL in a SSRS package for a parameter
SELECT DISTINCT convert(varchar, date, 103) AS Date
,convert(varchar, date, 103) AS Date Name
FROM [Server].[dbo].[date_Table]
WHERE ([date] >= '01-Jan-2018' AND [date] <= CURRENT_TIMESTAMP)
union
select '0', 'All Dates'
order by convert(varchar, date, 103)asc
Column [date]
is of type datetime
.
All the dates appear not to order by correctly.
Any ideas team why?
please help