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

Label to display date

Started by que1983, 19 Jan 2016 11:57:07 AM

Previous topic - Next topic

que1983

_first_of_month(_add_months (current_date;-1))
this display the first day of last month in an expression.  Lets say I also want a label that displays the first day of last month as this
December 2015 or Dec 2015 or 12/2015 in the label.  How would I do this dynamically in the label portion in properties

Nagendar

Hi que1983,

Dynamically means are you selecting date from any prompt...?

use layout calculation for dynamic display.

Thanks
Nagendar.

MFGF

Quote from: que1983 on 19 Jan 2016 11:57:07 AM
_first_of_month(_add_months (current_date;-1))
this display the first day of last month in an expression.  Lets say I also want a label that displays the first day of last month as this
December 2015 or Dec 2015 or 12/2015 in the label.  How would I do this dynamically in the label portion in properties

Assuming this is a query calculation, you can use the Data Format property to define how your date is displayed :)

MF.
Meep!

que1983

Can you provide an example

HalfBloodPrince

You can try this  calculations

cast(extract(month,_first_of_month(_add_months (current_date;-1))),varchar(2)) +'/' +cast(extract(year,_first_of_month(_add_months (current_date;-1))),varchar(4))  will give you 2/2016
------------------------------------------------------------------------------------------------
or you try below to get output like Feb -2016 but have to make 12 cases one for each month
-------------------------------------------------------------------------------------------------
if(extract(month,_first_of_month(_add_months (sysdate(),-1)))=1) then
('JAN -' +cast(extract(year,_first_of_month(_add_months (sysdate(),-1))) ,varchar(4)) )

else
if(extract(month,_first_of_month(_add_months (sysdate(),-1)))=2) then

('FEB -' +cast(extract(year,_first_of_month(_add_months (sysdate(),-1))) ,varchar(4)) )

else
(Null)