dbTalk Databases Forums  

Date Sensitive Extraction

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Date Sensitive Extraction in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim Heavey
 
Posts: n/a

Default Date Sensitive Extraction - 02-10-2005 , 07:33 AM






I am pretty much a novice on DTS, I have used it on very simple extractions
from Access to SQL. I am wanting to set an extract from an Oracle Table
which has a very large number of rows (millions) and I want to set up a DTS
package which will run weekly and pull 1 weeks worth of data and always pull
Sunday through Saturday.

I was thinking that I could specify something in the where statement in the
"DTS Import/Export Wizard" on the screen which show me the SQL. How can I
form a select statement which will extract Sunday thru Saturday? Would I be
using Oracle SQL or SQL SQL? I could always run the job, say on a Monday and
select rows from the prior 7 days, but if the job failed to run, for some
reason on Monday and it had to run on Tuesday, it would Extract Sun - Mon and
not Sat - Sun...Is there a way for it always select Sat - Sun no matter if it
runs on Monday, Tuesday, Wedn...??

Your assistances would be greatly appreciated.



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Date Sensitive Extraction - 02-10-2005 , 01:02 PM






The flavour of SQL you use is the one for the provider against which you
are querying.

So All you want is the 7 days worth of data previous to now right?

Have a look at

BETWEEN
DATEADD




"Jim Heavey" <JimHeavey (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am pretty much a novice on DTS, I have used it on very simple
extractions
from Access to SQL. I am wanting to set an extract from an Oracle Table

which has a very large number of rows (millions) and I want to set up a
DTS
package which will run weekly and pull 1 weeks worth of data and always
pull
Sunday through Saturday.

I was thinking that I could specify something in the where statement in
the
"DTS Import/Export Wizard" on the screen which show me the SQL. How can I

form a select statement which will extract Sunday thru Saturday? Would I
be
using Oracle SQL or SQL SQL? I could always run the job, say on a Monday
and
select rows from the prior 7 days, but if the job failed to run, for some

reason on Monday and it had to run on Tuesday, it would Extract Sun - Mon
and
not Sat - Sun...Is there a way for it always select Sat - Sun no matter if
it
runs on Monday, Tuesday, Wedn...??

Your assistances would be greatly appreciated.


Reply With Quote
  #3  
Old   
Steffany
 
Posts: n/a

Default Re: Date Sensitive Extraction - 02-10-2005 , 02:23 PM



I have used DTS to do the very same thing from Oracle. I have
successfully use this code in my WHERE clause...

WHERE (UpdatedOn > SYSDATE - 2)
AND (UpdatedOn < SYSDATE)

This brings back all the records from the Servers current DateTime back
2 days.

Steffany


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.