sql server - select a value between to specific dates

Hi

Im wanting to do a select query that selects a value from a table where its created date is in the range of 2 specific dates (date from & date to)

Thanks
LVL 1
razza_bAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
virtuadeptConnect With a Mentor Commented:
SELECT col_with_value
FROM the_table
WHERE col_create_date >= '1/1/2013'
AND col_create_date <= '2/1/2013'

you could use @variables instead of hard coded dates. Depends on what you are calling this from. Also post the table def and we can be more helpful.
0
 
Éric MoreauSenior .Net ConsultantCommented:
you can also use BETWEEN

SELECT col_with_value
FROM the_table
WHERE col_create_date BETWEEN '1/1/2013' AND '2/1/2013'
0
All Courses

From novice to tech pro — start learning today.