_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
Hi que1983,
Dynamically means are you selecting date from any prompt...?
use layout calculation for dynamic display.
Thanks
Nagendar.
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.
Can you provide an example
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)