Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date and time
Message
 
À
18/02/2014 10:07:48
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2008 R2
Application:
Web
Divers
Thread ID:
01594579
Message ID:
01594591
Vues:
58
>>>>>Hi all
>>>>>
>>>>>I have a date time and I want to return it in a query as dd/mm/yy and the time as 24 hour hours and minutes only
>>>>>
>>>>>so as an example 17/02/14 15:20
>>>>>
>>>>>any ideas what the best way to do that is ?
>>>>>
>>>>>Thanks
>>>>
>>>>It is a FrontEnd job to format DateTime type the way you want.
>>>
>>>Thanks Boris
>>>
>>>I'll put that in my little book of useless replies. :-)
>>>
>>>I think its your first entry.
>>>
>>>this is an sql command embedded in a classic asp page. What layer does that count as ?
>>
>>In your ASP page you should care HOW DateTime should be presented, not on SQL Server side.
>>What if you have more than one regional settings?
>>What if someone want to see this page in other format like dd.MM.yyyy hh:mm?
>
>As the sql is in the asp page I think that takes care of that.
>
>For this I don't have regional settings
>
>No one except the people who have asked for the format is ever going to look a this.


No, the poitn is not force SQL Server to return what you want, bnut to SHOW that DT field in the format you want.
DateTime.ToString("dd/MM/yy hh:mm");
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform