Re: Select statement: Data Time Stamp Manipulation
2015-10-04 17:12:14
The character representation of the CURRENT_TIMESTAMP is called a TIMESTAMP,
same for any date/time field in TIMESTAMP format. There are many functions
you can use against it to get portions of the field. The functions are:
DATE()
HOUR()
MINUTE()
SECOND()
to name a few. Look in the DB2 SQL Command Reference if you have it.
You can do something like this:
CURRENT_TIMESTAMP - 14 DAYS
CURRENT_TIMESTAMP - 2 HOURS
As arguments in a WHERE clause.
|
|
|