Select * 
From mytbl
Where datefield >= current_date - 30 days


Charles Wilt
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx 
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Kelly Jones
Sent: Monday, June 26, 2006 2:39 PM
To: java400-l@xxxxxxxxxxxx
Subject: SQL DateAdd help needed

Hi group,
I have been banging my head into a wall.  At some point our "date"
functions changed on the iSeries with respect to SQL queries.  So now
every time I have to deal with them, I get a headache.
I'm trying to do a simply select stuff from table where datefield >
I've tried using dateadd(day, -30, current_timestamp) and
current_timestamp and many combinations thereof with no luck.  Could
somebody be kind enough and provide an actual working sql 
statement that
will give me a resultset for records between 30 days ago and 
now?  As an
FYI, I'm trying to run this from the Op Nav "Run A Script" interface.
The iSeries is on V5R3.
And as long as I'm asking, I will need a "datediff" statement after I
get this one figured out.  ;-)
Kelly Jones
Sr. Web Developer
Chef's Catalog
ph: (719) 272-2600
fax:  (719) 272.2601
email: kjones@xxxxxxxxxxxxxxxx
web: <> 
This is the Java Programming on and around the iSeries / 
AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.