Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select by dates
Message
 
À
09/01/2013 08:51:13
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01561865
Message ID:
01561880
Vues:
41
>>>>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 ?
>>>>
>>>
>>>Pete,
>>>
>>>Can't test it right here, but try this
>>>
>>>
>>>where MyDateTimeColumn >='20121002000000'
>>>
>>Thanks Greg but it didn't work "Conversion failed when converting datetime to character string"
>>but if you read my updated post I have it worked out now, thanks again.
>
>
>Yes,
>
>Just found out that adding time can be done like this
>
>where MyDateTimeColumn >='20121002 00:00:00"
>
Worth knowing - thanks again
Regards,
Peter J. Kane



Pete
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform