Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

UCT to WST -15min Expand / Collapse
Author
Message
Posted Thursday, October 11, 2012 11:00 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:39 AM
Points: 1,681, Visits: 752
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





Post #1371890
Posted Thursday, October 11, 2012 11:35 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 12:15 AM
Points: 2,837, Visits: 3,957
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
Post #1371893
Posted Sunday, October 14, 2012 5:03 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:39 AM
Points: 1,681, Visits: 752
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





Post #1372546
Posted Sunday, October 14, 2012 11:08 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 12:15 AM
Points: 2,837, Visits: 3,957
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
Post #1372558
Posted Sunday, October 14, 2012 11:49 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 12:39 AM
Points: 1,681, Visits: 752
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





Post #1372561
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse