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

custome date prompt with html item

Started by philelmousse, 16 Dec 2011 06:16:05 AM

Previous topic - Next topic

philelmousse

Hello,

I would like fill my date prompt with the first day of the previous month.

I looked a script on internet and add something like that in my prompt page

<script type="text/javascript">
var today = new Date();

var first = new Date(today.getFullYear(), 0, 1);

var strYesterday = [today.getUTCFullYear(), first.getMonth()+1, first.getDate()].join("-");

genSelectDateHTML("promptDate_from", 'formWarpRequest', "P_Date_from", 'XML', "", strYesterday, , 'Gregorian', 'editBox', 'editBox', , "", "", 1, RANGE_EQUAL_VALUE, true, false, false, false, false, false, "", "", "", "", "", "");
</script>


But it doesnt work I still have the current date in the prompt. Do you have an idea of the issue ?

Thanks

kattaviz

Hi,

If that is the case why not use "_first_of_month (_add_months (current_date,-1))" as a filter expression.

The above expression will always give the First day of previous month.
thanks & regards
Satish Katta