Hi,
I want to select all records that would have a maturity date that falls within the 6 month from the current month or selecting all records that would mature in the 6 month from the current month.
Thanks
Printable View
Hi,
I want to select all records that would have a maturity date that falls within the 6 month from the current month or selecting all records that would mature in the 6 month from the current month.
Thanks
On which db system? Use dateadd function in ms sql server.
First I want to add 6 months to the current date and then extract the month and year from the resulting date.When I run these queries(given below) separately, it works fine, but could someone tell me how to trim the day out of this date.
SELECT month( ADD_MONTHS(CURRENT_TIMESTAMP,6)) from SYSIBM.SYSDUMMY1
SELECT year( ADD_MONTHS(CURRENT_TIMESTAMP,6)) from SYSIBM.SYSDUMMY1
You still didn't tell which db system used. Different system has different functions and syntax.
I an using DB2.
select CAST (colmname as smalldatetime) from tablenameQuote:
Originally Posted by Jayshree
select CAST (posdt as smalldatetime) from ex
u can use this to trim the datetime