This discussion is archived
4 Replies Latest reply: Jan 17, 2013 1:38 AM by Bhargav K RSS

Regarding Date column

Bhargav K Newbie
Currently Being Moderated
Hi experts,

can any one help me pls..

i have one column having month&year data like jan-12,jan-13,feb-12,feb-13 .....

i need to create a dashboard prompt on this column..
here i need current month-current year as the default value(like in above date format) in the prompt for the user when ever he runs the dashboard..

how to get this...help me pls


thanks in advance
  • 1. Re: Regarding Date column
    Srini VEERAVALLI Guru
    Currently Being Moderated
    Try this

    concat(concat(substring(monthname(current_date),1,3),'-'),substring(cast(year(current_date) as char),3,4))

    In detail:
    substring(monthname(current_date),1,3) -->returns month in short
    substring(cast(year(current_date) as char),3,4)--> returns year in

    You might have to use the below query at Defailt to
    SQL Results

    and use like

    SELECT concat(concat(substring(monthname(current_date),1,3),'-'),substring(cast(year(current_date) as char),3,4))
    FROM <Your Subject Area> order by <any one column from subject area>

    Appreciate if you mark as correct/helpful

    Edited by: Srini VEERAVALLI on Jan 16, 2013 9:20 PM

    Edited by: Srini VEERAVALLI on Jan 16, 2013 10:58 PM
  • 2. Re: Regarding Date column
    Bhargav K Newbie
    Currently Being Moderated
    Hi Srini,

    wat u said was help ful...

    but here i am using one Mon&Year column in the report and dashboard also..

    based on that prompt report should change... if we used the query that u proposed how it will effect the report???

    can u pls guide me
  • 3. Re: Regarding Date column
    Srini VEERAVALLI Guru
    Currently Being Moderated
    If these values Jan-13 are based on two columns expression then you need to use same expression in report and set to Is Prompted, since your values are not based on direct column.
    If not split them year and month and set constrain on month if required.
  • 4. Re: Regarding Date column
    Bhargav K Newbie
    Currently Being Moderated
    Hi Srini,

    Thanq for ur respose . okay i will do work around.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points