Problem solve Get help with specific problems with your technologies, process and projects.

More query date manipulation

By manipulating the file field you can create a date field within the query and be able to use current(DATE) against non-date fields.

You Can View User Feedback To This Expert Q&A

While getting the current date with the function current(DATE) function works very well, what if I need to compare the current date against a non-date field? By manipulating the file field you can create a date field within the query and be able to use current(DATE) against non-date fields.

 
TRDATE      digits(rdsodt)

TR1         substr(trdate,4,2) || '/' ||
            substr(trdate,6,2) || '/' ||
            substr(trdate,2,2)

TR2         date(tr1) 

USER FEEDBACK TO THIS EXPERT Q&A

  • Why not combine all three steps into one? See below example: date(substr(digits(ddate),5,2)|| '/'||substr(digits(ddate),7,2)|| '/'||substr(digits(ddate),1,4)) — Karen Hodge

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.


Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close