Click here to Skip to main content
15,897,032 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
In my table I have

YEAR and MONTH
2014 02
There is an option for the users to select date ranges

so when I try to select

I use this syntax:

Select * from dbo.User where YEAR and MONTH between '2014' and '02' and '2014' and '03'

I have no IDEA how to acieve this. help please
Posted

1 solution

Select * from dbo.User where YEAR = '2014' and MONTH IN ('02','03')

Read more: sql_where[^]
 
Share this answer
 
v2
Comments
JB0301 5-Jun-14 3:24am    
Thank you sir!
Peter Leow 5-Jun-14 3:24am    
You are welcome.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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