>>Hi all, I have a table containing a DateTime column, how can I retrieve all records on or after a date such as 01/10/2012 ? I've tried
>>
>>
>> Select *
>>from mytable
>>where convert(varchar,MyDateTimeColumn,3) >= '01/10/12' but I'm still getting records with a date prior to that e.g I get records back with '23/07/12' - any ideas ?
>>
>
>To get all rows for the date of January 10, 12 use
>
>select * from myTable
>where MyDateColumn >='20120110' and myDateColumn < '20120111'
>
>See this blog post
>
Bad habits to kick : mis-handling date / range queriesThanks Naomi - I know it's probably not what the purists would do but I needed a quick solution for a report - which I now have :-)
Regards,
Peter J. Kane
Pete