SQL Server 2000
How do I write in a stored procedure a parameter Quarter @Q:
Q1 FJ.repdate BETWEEN jan1-march31 2010 (or 2011 or any year)
Q2 FJ.repdate BETWEEN april1-june30 2010 (or 2011 or any year)
Q3 FJ.repdate BETWEEN july1-sept30 2010 (or 2011 or any year)
Q4 FJ.repdate BETWEEN oct1-dec31 2010 (or 2011 or any year)
.....
WHERE
(Job.Co='A' or Job.Co='B' )
AND FJ.Customer='ABC'
AND @Q=….
It has to retrieve data for each year, as well.
Pls help
How do I write in a stored procedure a parameter Quarter @Q:
Q1 FJ.repdate BETWEEN jan1-march31 2010 (or 2011 or any year)
Q2 FJ.repdate BETWEEN april1-june30 2010 (or 2011 or any year)
Q3 FJ.repdate BETWEEN july1-sept30 2010 (or 2011 or any year)
Q4 FJ.repdate BETWEEN oct1-dec31 2010 (or 2011 or any year)
.....
WHERE
(Job.Co='A' or Job.Co='B' )
AND FJ.Customer='ABC'
AND @Q=….
It has to retrieve data for each year, as well.
Pls help