Link to home
Start Free TrialLog in
Avatar of carlbb
carlbb

asked on

Using DATE in AS400 DDS

I have a request to create a logical file that include records with a transaction date within the last 30 days and omits all others. The the only way I know how to do this would be to auto run a SQLRPGLE job every AM to reset the date and recreate the logical file. Is there any way to do this via DDS?

Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

No way I know of to do it via DDS, but it is easy with SQL:

- Gary Patterson







CREATE VIEW MyTableLast30 AS
   SELECT * from MyTable WHERE somedate >= current_date - 30 days 

Open in new window

Avatar of carlbb
carlbb

ASKER

Would the view need to be dropped and created each day?
ASKER CERTIFIED SOLUTION
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of carlbb

ASKER

Thank you Gary that will get me started, if have other questions I will do another post.

Thanks again
Carl
Happy to help.

- Gary