Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DateTime format
Message
 
 
To
15/02/2003 13:10:56
Anderson Girardi
Athenas Automação de Escritório
Porto Alegre, Brazil
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00753734
Message ID:
00753747
Views:
22
You can use SET DATEFORMAT command or CONVERT function to do that.
DECLARE @Str varchar(16), @dt datetime
SET @str = '22/02/2003 14:48'
-- CONVERT
SET @dt = CONVERT(datetime, @str, 103)

-- SET DATEFORMAT
SET DATEFORMAT dmy
SET @dt = CAST(@str AS datetime)
-- Restore DATEFORMAT
SET DATEFORMAT mdy     -- or whatever defaul it is 
>Dear friends,
>there´s any way to me format a input to a dateTime field in the follow format
>
>dd/mm/yyyy hh:mm
>
>thanks
>
>Anderson Girardi
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform