Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select * from gen_complaints where date between ('2011/01/01' , '2011/12/01') 

That is my query it is not working can any one give correct format.
Posted
Updated 5-Jan-12 2:13am
v2

Maybe try


SQL
select * from gen_complaints where (date between '2011/01/01' AND '2011/12/01')
 
Share this answer
 
Comments
RDBurmon 6-Jan-12 2:03am    
Good solutions. But I am bit worried that Why janareddyjanareddy have not used the google to learn how to use "between" clause in T-SQL? are you ?
Since the date format in sql is 'yyyy-mm-dd' you can try with this.
 
Share this answer
 
v2
Comments
Mehdi Gholam 7-Jan-12 4:32am    
Not an answer
This will work

select * from gen_complaints where date between Convert(datetime,'01/01/2012'104) AND Convert(datetime,'01/12/2012',104) 


Thanks
 
Share this answer
 
v2

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