× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Actually Sean that was a LOT simpler than what I thought it should be.
I don't know what I was trying to remember.
Thanks for your help.


Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx

rpg400-l-bounces@xxxxxxxxxxxx wrote on 02/16/2007 10:26:54 AM:

As an example, does this provide the correct records to delete ?
(untested): -

select timestamp_iso(date(current timestamp -7 days)), filetimestamp
from file where filetimestamp < timestamp_iso(date(current timestamp -7
days))

You may want to subtract 8 days ?



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: 16 February 2007 15:17
To: rpg400-l-bounces@xxxxxxxxxxxx; RPG programming on the AS400 /
iSeries
Subject: SQL date help



Mornin' everyone
I know I've seen a couple of articles dealing with dates in SQL, but I
am going nuts in trying to locate them.(Some would say I'm already
there) Anyway, what I have is a file with a timestamp as one of the
fields on the record showing the date that the record was created. What
I want to do in SQL, is obtain todays date as a timestamp, subtract 1
week (7 days) from that date and make that timestamp be midnight on
that, then delete all records on the file with a timestamp of less than
the calculated timestamp.
If anyone can either help me out as to how to obtain todays date in SQL,
it would be much appreciated.
Thanks in advance



Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.