Click here to Skip to main content
15,843,865 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this doesn't work:

SQL
Select * from Orders2 where quarter([OrderDate]) >= 1 AND year([OrderDate]) >= 2010 and quarter([OrderDate])<=12 and year([OrderDate]) <= 2011


what is the command for quarter?
Posted

1 solution

Here, try this:
SQL
SELECT DATEPART(quarter, OrderDate) 
--OR  
SELECT DATEPART(qq, OrderDate) 
--OR  

SELECT DATEPART(q, OrderDate)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900