%CurrentDateIn Meta-SQL Function

Your rating: None Average: 3.3 (7 votes)

A very useful PeopleCode Meta-SQL function. I will be providing an
example and how %CurrentDateIn function will be resolved at run time.
But first, this is how PeopleSoft explains it:

The %CurrentDateIn meta-SQL variable expands to a platform-specific SQL
substring representing the current date in the Where clause of a SQL
Select or Update statement, or when the current date is passed in an
Insert statement.

And here is an example:

SELECT 'X'
FROM dual
WHERE sysdate > %CurrentDateIn;

At run time, the SQL above will be resolved to look like this:

SELECT 'X'
FROM dual
WHERE sysdate > To_Date(To_Char(SYSDATE, 'YYYY-MM-DD'), 'YYYY-MM-DD');

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!