How do I provide current year in URL parameter.

(2 posts) (2 voices)

Tags:

No tags yet.

  1. hubcarter, Member

    I am using a url to present a report in a 'dashboard'. One of the parameters in the report is for the selection of year, but within the dashboard I do not wish to request year but default to current year.

    Until I understand how to do this I am providing the year as a constant (see example below for u1=)

    https://xxx.xxx.com/mydbr/report.php?r=56&m=1&u1=2015&h=d9c0687af72a6ad74ded21ba4df6a8ed3816c066&embed=1

    Anyone have an idea as how replacing the constant 2015 with a variable or function?

  2. myDBR Team, Key Master

    If you always want to use current year, you can get it using SQL's date functions (no need to pass it as a parameter):

    In MySQL:

    year(curdate())

    In SQL Server/Sybase:

    year(getdate())

    --
    myDBR Team


Reply

You must log in to post.