Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving Records by Date alone(time excluded)
Message
De
11/08/1999 14:46:24
 
 
À
10/08/1999 10:54:57
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00251925
Message ID:
00252658
Vues:
7
>>Hi! I'm having trouble in querying my tables. I have the ff. syntax:
>>
>>Select * from mytable where mydatecolumn='08/10/1999'
>>
>>It returns no rows though the table is not empty. How do I fix this so that I get all the records regardless of what time during the day they were saved. Thanks for all the help!
>>
>>Carlos
>
>It's been a while, but try
>
>SELECT * from mytable where CONVERT( C(10),mydatecolumn,101)='08/10/1999'
>
>this gives date in mm/dd/yyyy format

I think that its char(10) rather than c(10) (in SQL 6.5 anyway)

You can also try

SELECT * from mytable where mydatecolumn like 'Aug 10 1999%'
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform