Hey i can’t seem to be able to solve this, i have this query :
SELECT DISTINCT CONVERT(VARCHAR(8), time, 4) AS Batch
FROM Calls
ORDER BY Batch
Which orders the columns by days and not as regular date, meaning i get something like :
1.11.12
1.12.12
2.11.12
3.11.12
4.11.12
How am i able to solve this?
if i try and order by time, the query won’t distinct the values and messes up my all query.
Meaning this :
SELECT DISTINCT CONVERT(VARCHAR(8), time, 4) AS Batch , time
FROM Calls
ORDER BY time, Batch
Orders the query fine but won’t distinct the values.
try this
update:
SQL FIDDLE EXAMPLE