Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 us and uk working times

Author  Topic 

php95saj
Starting Member

43 Posts

Posted - 2002-12-10 : 11:14:23
Guys, I have a table that is storing results of a survey. The server is hosted in UK and is storing datetime accordingly (i.e. GMT). I need to filter records according to us working hours and uk working hours. Any ideas how to achieve this?
Thanks in advance.

Sharjeel

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-12-10 : 11:20:42
The only way for you to do this correctly is to somehow flag the rows based on time zone. There is considerable overlap in working hours between the US and UK, and without a timezone indicator you won't be able to categorize them easily. If there is some other column that you can use to indicate where the work was done you might have better luck.

Go to Top of Page

VyasKN
SQL Server MVP & SQLTeam MVY

313 Posts

Posted - 2002-12-10 : 11:26:19
You could store time in GMT, instead of local time (In this case, GMT and local time are the same, since the server is in UK). You could do this using GETUTCDATE in SQL Server 2000.

Then use an appropriate offset in your queries. You won't need any offset when querying for UK working hours. You could use the same query, when querying for US work hours, but just deduct 7 (or how many ever) hours from the time.

--
HTH,
Vyas
http://vyaskn.tripod.com
Go to Top of Page

php95saj
Starting Member

43 Posts

Posted - 2002-12-10 : 11:27:48
Rob, I am trying to display response of a survey. I get results like say for example:
Hour Usage (%)
=====================
0 2116 (6.3%)
1 2059 (6.1%)
2 1895 (5.9%)
etc..

All I want to do is to filter results so that
if I say display the same results but for (working hours ) according to EST (which should be between 14:00 - 22:00 hours for the sake of argument).


Go to Top of Page
   

- Advertisement -