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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi ShekharPosted Jul 8, 2013, 8:04 AM
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.
Pankaj PandeyPosted Jul 8, 2013, 7:08 AM
select * from yourtable where date1 between '2013-03-05' and '2014-03-05'
Iftikar HussainPosted Jul 8, 2013, 5:40 AM
Please provide more details.
Regards,
Iftikar
Sanjeeb LenkaPosted Jul 8, 2013, 5:28 AM
Jignesh TrivediPosted Jul 8, 2013, 5:27 AM
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.