Hi
i have the following situation. in my database i have a datetime field (dd/mm/yy hh:mms) and i also have a field timezone.
the timezone field has values in minutes that i should add to my datetime field so i have the actual time.
afterwards i split the datetime into date and time.
the last part i can accomplish (CONVERT (varchar, datetime, 103) as DATEVALUE and CONVERT (varchar, DATETIME, 108) as TIMEVALUE).
could anybody tell me how i can add the timezone value (in minutes) to my datetime value ?
i do all the calculations in my datasource (sql).
Thanks
V.
at the end i found it myself
this is how i solved it.
to add the timezone value (in minutes) to my datetime i used following :
DATEADD(minute, TimeZone, DATETIMEVALUE) AS ACTUALDATETIME
this expression will add the timezone value (example 60) to my current date time value (12/06/2007 08:00:00) and store it in
actualdatetime value (12/06/2007 09:00:00).
from then on it's easy to extract date and time from the result.
CONVERT(varchar, (DATEADD(m,TimeZone,DATETIME)), 103) AS DATEVAL for the DATE
CONVERT(varchar, (DATEADD(m,TimeZone,DATETIME)), 108) AS TIMEVAL for the time.
i thank myself for my research .. lol
Greetings to all
No comments:
Post a Comment