SYNAX OF FROM DATE AND TODATE IN SQL2005
HOW TO GET DATA FROM TWO DIFFERENT DATES IN SQL 2005 BY USENG SELECT QUERY.DATATYPE IS DATETIME
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 8, 2013, 1:27 AM EDT
hi,
you can try following query with correct table name and date..
select * from table1 where CreatedDate between '2011-02-25' and '2012-02-07'
hope this will help you.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 8, 2013, 1:28 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Jul 8, 2013, 1:40 AM EDT
Please provide more details.
Regards,
Iftikar
Pankaj PandeyRank #642 · 3.7K reputationPosted Jul 8, 2013, 3:08 AM EDT
select * from yourtable where date1 between '2013-03-05' and '2014-03-05'
Ravi ShekharRank #673 · 3.6K reputationPosted Jul 8, 2013, 4:04 AM EDT
Try this,
select * from table where CreatedDate between convert(varchar,'2011-02-25',101)
and convert(varchar,'2011-02-30',101)
go throuh with below link for datetime format conversion
http://www.blackwasp.co.uk/SQLDateTimeFormats.aspx
http://www.w3schools.com/sql/func_convert.asp
Regards,
Ravi
accept as answer if it helped.