How to get time from datetime
Sorry if this has been asked befor, but I couldn't find anything that hepled me.
I have a datetime field and want to extract only the time. I know it works with CONVERT and style-type 108. But I get something like this: 08:00:00 and I need something like this: 08:00.
Can this somehow be done?
Michael
universal format for datetime insert?
Quote:
Originally posted by MAK
select left(convert(varchar(10),getdate(),108),5)
Great! Thanks a lot. I have one other problem, maybee you can help me here too:
Depending on what version (German, English etc) of MS SQL Serve you are using it needs other formats when you want to put a date AND time into a datetime column.
Is there a universal format that every MS SQL Server accepts?
Michael
similar problem and I'm a newby
I have a similar issue but am new to this so please go easy.
I have a db datetime field. With a stored proc using a view I want to convert the datetime to be just the date, no time returned at all.
I have the date field in the view but an not sure of the syntax.
Please help?:confused:
Thanks in advance,
Whack
Promise date is a datetime column 8 allows nulls
My view code is as follows...
convert(varchar(10), dbo.[Order].manual_promise_date,110) AS ManualPromiseDate
any ideas or articles. Must be something I'm not getting. I even tried to change the 110 to something else but I keep getting the date in the following format.
<PromiseDate>2003-02-06T00:00:00.0000000-05:00</PromiseDate>
Pulling out what little hair I have left.....