Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

last_n_days alternative in oracle

937454Sep 19 2013 — edited Sep 19 2013

Hi,

My db version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

I have to load data from salesforce application to oracle database.

The data in salesforce is in GMT timezone. I need to extract data that is modified only within 24 hours. That means from today 12am to yesterday 12am in EST time.

So I am retrieving data for last 2 days from salesforce which is in GMT.

Then I am using:

NEW_TIME ('lastmodifieddate', GMT, EST)

to covert the dates into EST timezone. Now I have get only those records which fall within 12am of each day to 12 am of each previous day.

In Salesforce SOQL, they have a date function : LAST_N_DAYS:n ---For the number n provided, starts 12:00:00 of the current day and continues for the last n days.

Do we have anything in oracle that provides same functionality?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 17 2013
Added on Sep 19 2013
8 comments
762 views