SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


UCT to WST -15min


UCT to WST -15min

Author
Message
Ford Fairlane
Ford Fairlane
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3272 Visits: 836
Hi,

So I need to write a query that will if something was modified in the last 15 min. The problem is that the data is stored as UCT time and I am WST so UST +8

ie so if I had to make a change at say 2pm it would show up in the database as taking place at 6am when I did a straight select from that table...

So how do I select x, y, z, from T where z <= 15

z is in uct format and 15 is equal to current time - 15 min

Hope this helps...

Ford Fairlane
Rock and Roll Detective





Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13094 Visits: 4077
use select getutctime() , it will give you GST time then use select dateadd() function to get required reuslt

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Ford Fairlane
Ford Fairlane
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3272 Visits: 836
Dont you mean GETUTCDATE() ?? I have tried using that but then I still need to add 8 hours to it and then do a time comparision for the last 15 min all within a where clause.... and that is where I am getting lost...to many identifiers

Hope this helps...

Ford Fairlane
Rock and Roll Detective





Bhuvnesh
Bhuvnesh
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13094 Visits: 4077
Ford Fairlane (10/14/2012)
I still need to add 8 hours to it and then do a time comparision for the last 15 min all within a where clause
Yes i have to do this

Ford Fairlane (10/14/2012)
and that is where I am getting lost...to many identifiers
Confusion ?? What ??

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Ford Fairlane
Ford Fairlane
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3272 Visits: 836
Bhuvnesh - I have no idea what your last post ment if anything......

I appreciate you help but I dont understand a thing you have said....

Hope this helps...

Ford Fairlane
Rock and Roll Detective





Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search