I have the following MySQL Query:
SELECT date, time, custom_id, Number
FROM traffic t
WHERE CONCAT(date, " ", time) BETWEEN "01/06/2014 00:00" AND "01/10/2014 23:00"
AND Number =
(SELECT MAX(CAST(Number as SIGNED)) FROM traffic WHERE t.date = date and t.custom_id = custom_id)
ORDER BY date, CAST(Number as SIGNED) DESC, custom_id
This is the SQLFiddle in MySQL (working): http://sqlfiddle.com/#!2/6e1248/3
How can I convert/translate it to MS SQL? SQLFiddle (not working): http://sqlfiddle.com/#!6/6e124/1
Thanks in advance
betweenwill not work when it crosses month boundaries.