dbTalk Databases Forums  

What should be a simple date problem...

comp.database.oracle comp.database.oracle


Discuss What should be a simple date problem... in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Richard Whittaker
 
Posts: n/a

Default What should be a simple date problem... - 05-25-2005 , 02:06 PM






Greetings:

I have what should be a fairly simple date problem, but I am just not having
any luck getting it to work...

I have a table with a column of DATE type. This column is called CLSDDATE, and
all values in there are GMT based.

I have a server that's sitting in PST, and what I would like to do is create a
query of all rows that have a date value within the last hour, and for the
life of me, I cannot figure out how to get this to work...

I've tried the following, with no success..

SELECT WO_NUM,EMAILADDR FROM TASKS WHERE CLSDDATE > SYSTIMESTAMP - (60/1440);

Since all dates are in GMT, this gets everything within the past 9 hours,
which is not what I wanted... I know there's probably a simple way to do this,
but I am flummoxed...

Any thoughts/suggestions would be MUCH appreciated...

Thanks,
Richard.


Reply With Quote
  #2  
Old   
Matthias Hoys
 
Posts: n/a

Default Re: What should be a simple date problem... - 05-25-2005 , 03:48 PM







"Richard Whittaker" <richpop (AT) connections (DOT) yk.ca> wrote

Quote:
Greetings:

I have what should be a fairly simple date problem, but I am just not
having
any luck getting it to work...

I have a table with a column of DATE type. This column is called CLSDDATE,
and
all values in there are GMT based.

I have a server that's sitting in PST, and what I would like to do is
create a
query of all rows that have a date value within the last hour, and for the
life of me, I cannot figure out how to get this to work...

I've tried the following, with no success..

SELECT WO_NUM,EMAILADDR FROM TASKS WHERE CLSDDATE > SYSTIMESTAMP -
(60/1440);

Since all dates are in GMT, this gets everything within the past 9 hours,
which is not what I wanted... I know there's probably a simple way to do
this,
but I am flummoxed...

Any thoughts/suggestions would be MUCH appreciated...

Thanks,
Richard.

Have you tried this in the same session :

ALTER SESSION SET TIME_ZONE = local;

This sets the time zone to the operating system time zone.
It works for Oracle 9i, don't know about 8i/10g (you didn't specify your
Oracle version).


HTH
Matthias




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.