I want to customize my order by , if the Qty is negative then that row must be in fist then if the Qty is positive I will sort it by ExpDate
My Query is this .
Select WhsCode,ItemCode,LotNumber,ExpDate,Qty from rq_Test2 order by case when qty < 0 then Qty else ExpDate end
But I am getting an error of " Arithmetic overflow error converting expression to data type datetime. " .. Why ?
Thanks ..
Aucun commentaire:
Enregistrer un commentaire