all groups > sql server data warehouse > may 2004 >
You're in the

sql server data warehouse

group:

Data Type (Time Format)


Re: Data Type (Time Format) Adam Machanic
5/20/2004 12:31:33 PM
sql server data warehouse:
There is no datatype in SQL Server for just time. However, display is a
client issue; you should be able to pull just the time element out in
whatever language you're using for reporting/application development. You
can also use CONVERT to pull the time out as a text string:

SELECT CONVERT(CHAR(8), YourDateTimeCol, 8) AS TheTime
FROM YourTable

If, as I suspect, what you're storing is actually a duration, you might
consider storing it as number of seconds in a column of integer datatype
instead of using datetime. This will make calculations (if necessary) much
easier.


[quoted text, click to view]

Data Type (Time Format) VampireJ
5/20/2004 12:55:51 PM
Hi all,

I have a colume assigned to datetime format, where the value is say
"06:31:31" rather than 20/05/2004 06:31:31. When I retrieve the value from
the table, the result were 30/12/1899 06:31:31. Is there a way to change the
format so that I only need to put the time variable into the field as
opposed to the full datetime format?

Thanks

Re: Data Type (Time Format) VampireJ
5/21/2004 11:01:31 AM
Thanks very much, I will give that a try.

[quoted text, click to view]

Re: Data Type (Time Format) (a_shahnazari NO[at]SPAM yahoo.com)
6/18/2004 11:04:24 AM
hi
i have the same problem that you have.
can you please let me know if you find the solution.
thanks
alina

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
AddThis Social Bookmark Button