COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: venkiatmaruthi on 04 Jan 2011 04:13:05 AM

Title: _first_day_month() function
Post by: venkiatmaruthi on 04 Jan 2011 04:13:05 AM
Hi,

This function is working fine.
_first_of_month(current_date)

But I am not able to give maually the date. its giving error.
_first_of_month('1-10-2010')

I tried this way as well but no result.
_first_of_month(cast('1-10-2010',Date))

help me plz....
Title: Re: _first_day_month() function
Post by: venkiatmaruthi on 04 Jan 2011 04:23:26 AM
ok I made it at last.

_first_of_month(2010-01-15)

this is working now.
Title: Re: _first_day_month() function
Post by: sir_jeroen on 04 Jan 2011 09:18:48 AM
if it's oracle you could also use: trunc(<date field>;'MM') MM = truncate date to first of month; Same for YYYY: truncate to first of year... etc.
Title: Re: _first_day_month() function
Post by: venkiatmaruthi on 05 Jan 2011 04:05:56 AM
Thanks for your suggesion.