Sean Lange (10/11/2013)
smharabbani40 (10/11/2013)
Hi I need a Query from the month 112013 to 122013 sir......i have used the below Query which is not satisfieing.
SELECT Emp,
SUM (AMOUNT),
Monthyear
FROM table WHERE MonthYear between 112013 and 122013
GROUP BY Emp
Sorry to say ,if it very easy thing i wont put in here.
anyhow thanks for your replay
That query won't run because you did not also group by Monthyear.
It seems like Monthyear is an int datatype? If at all possible I would highly recommend changing to a date or datetime datatype instead. It will provide instant validation that the data entered is valid and it will let you do datemath without being forced to cast/convert it first.
Plus 1 billion to that.
--Jeff Moden
Change is inevitable... Change for the better is not.