Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Yea, still a char.
I can't believe they did not think of the need for a function in these cases.
oh well
thanks Chris
>How about this:
>
>CONVERT(varchar, datetimefld, 102)
>
>or
>
>CONVERT(varchar, datetimefld, 111)
>
>
>>Chris,
>>107 still I cannot Sort, and 112 will be hard to read for the user.
>>
>>any other ideas?
>>
>>
>>>I think this will give you the order you want:
>>>
>>>CONVERT(varchar, datetimefld, 112)
>>>
>>>While this gives the formatting:
>>>
>>>CONVERT(varchar, datetimefld, 107)
>>>
>>>
>>>>On a datetime field I need to get only the date, not the time.
>>>>
>>>>I've tried LEFT(CAST(datetimefld AS CHAR),11) but it gives me, of course, a char field that I cannot sort by correctly.
>>>>How can I get this as a DATE ?
>>>>Jan 11 2003 looks nice for what I want, but again, I cannot order it in this way
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement