I am facing problem when i'm trying to select records from a table between two dates.
m using the following query
select * from xxx where dates between '10/10/2012' and '10/12/2012'
this query works for me but when the dates are in format like 1/1/2013.. it doesn't work..
plz solve my problem ASAP.
you have to split the datetime and then store it with your desired format like dd/MM/yyyy. then you can use this query with between but i have objection using this becasue it will search every single data on your database,so i suggest you can use datediff.
here i have used dd/MM/yyyy format.
Try this
or
use this
you are entering string, So give the name of month as according to format...