Well, you will need to use CURRENT DATE along with some DB2 functions and some additional logic. First of all, the following functions will return the day, month, and year component of a date:
So, for today, the first would return 12, the second 5, and the last 2003. To get that into your format you would have to do something like this:
YOUR_FORMAT_DATE = ((YEAR(CURRENT DATE) - 2000) * 10000) +
(MONTH(CURRENT DATE) * 100) +
That should return the date in the numeric format you want (at least until the year 2100). But you'd be much better off using DB2 dates in your tables!
Dig Deeper on IBM DB2 management
Related Q&A from Craig S. Mullins
Our expert suggests that the best way to pass the SAP BW exam is to have hands-on job experience. But that's not all he has to say about ... Continue Reading
To export data from a DB2 table to a flat file, you need to run an export specifying the proper file format. The export utility exports data from a ... Continue Reading
Craig Mullins recommends two specific resources for learning how to create and support Binary Large Objects (BLOB) in DB2. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.