If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

make_timestamp of last day of a month

Started by philelmousse, 08 Sep 2011 06:06:17 AM

Previous topic - Next topic

philelmousse

I would like create a timestamp with the last day of a month. I have a prompt with the month and the year but for the day I dont know how generate the last day of the selected month.

I only have make_timestamp(?Year?,?Month?,) for now... What could I put for the third parameter ?

philelmousse

Just found it...

_make_timestamp (  ?year?,?Month?,_days_to_end_of_month (_make_timestamp (  ?year?,?Month?,0  )))

philelmousse

the '0' value in the make_timestamp returns that error :

UDA-SQL-0114 The cursor supplied to the operation "sqlOpenResult" is inactive. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. (SQLSTATE=22007, SQLERRORCODE=242)

What could I use ?

sjfamily84

Would the 1st day of the next month, minus 1 day work?

Lynn


Quote_last_of_month ( date_exp )
Returns a date or datetime, depending on the argument, that is the last day of the month represented by "date_exp".


_last_of_month( _make_timestamp (  ?year?, ?Month?, 1  ) )