The default format used for dates is determined by the territory code of the DB2 database (which can be specified at database creation time). For example, my database was created using territory=US. Therefore the date format looks like the following:
values current date
1
----------
05/30/2003
1 record(s) selected.
You may get the territory code from DB CFG.
db2 get db cfg | egrep 'code|territory'
Database territory = US
Database code page = 1208
Database code set = UTF-8
Database country/region code = 1
That is, the format is MM/DD/YYYY. If you want to change the format, you can bind the collection of db2 utility packages to use a different date format.
To get the current date, time, and timestamp using SQL,(basically gives you an idea of what the date format is) reference the appropriate DB2 registers:
The sysibm.sysdummy1 table is a special in-memory table that can be used to discover the value of DB2 registers
db2 "SELECT current date FROM sysibm.sysdummy1 "
1
----------
06/02/2014
1 record(s) selected.
The DATE function still works even if we leave out the quotes in the function, but the result is not correct:
db2 "SELECT date(2001-09-22) FROM sysibm.sysdummy1 "
1
----------
05/24/0006
1 record(s) selected.
When the DATE function gets a character string as input, it assumes that it is valid character representation of a DB2 date, and converts it accordingly. By contrast, when the input is numeric, the function assumes that it represents the number of days minus one from the start of the current era (that is, 0001-01-01). In the above query the input was 2001-09-22, which equals (2001-9)-22, which equals 1970 days.
And if all the above are applicable, the below command should work fine for your issue.
SELECT * FROM table WHERE registrationdate > '10/01/2002';