LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 4 Feb 2003 18:32:40 -0800
Reply-To:   Michelle Jellinghaus <michelle@EMODE.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Michelle Jellinghaus <michelle@EMODE.COM>
Organization:   Verio
Subject:   SAS/SQL date field query

When querying an Oracle database through SAS/SQL, what code would I write to get a dataset that includes only those observations that occur later than a particular date?

For example, let's say there's a table in our Oracle data warehouse called 'testdata' and it has a datetime field called 'finish_time'. If I want only those observations that have a 'finish_time' later than Jan 1, 2003, what would the WHERE statement look like? I don't see any way to do this by using the Query tool & have attempted a few where statements with little success using proc sql. You'll notice that the where statement below is, well, less than optimal ;)

Here's what I have so far:

proc sql; connect to oracle(user='xxxxx' pass='xxxxx' path='xxxxx'); create table testdata as Select INDEXFIELD, FINISH_TIME, VAR1 from connection to oracle(select A1."INDEXFIELD", A1."FINISH_TIME", A1."VAR1" from DATA.TESTDATA where /* help!?!?!*/ ) as t1( INDEXFIELD, FINISH_TIME, VAR1) ;

Any ideas would be greatly appreciated.

M


Back to: Top of message | Previous page | Main SAS-L page