Today's date in SQL
- Article Type: General
- Product: Aleph
- Product Version: 20
Description:
You want to compare a certain value to today's date (or to today's date - x days) in SQL.
Resolution:
The variable you use is "SYSDATE". But to compare it to a standard ALEPH 8-character date, you need to include a TO_CHAR:
SQL> select z36_rec_key, z36_id from z36 where z36_loan_date = TO_CHAR (SYSDATE, 'YYYYMMDD');
[The preceding query will give you a list of item-keys/user-ids for items checked out today.]
Additional Information
date, SQL, current date
- Article last edited: 10/8/2013