If you are unable to create a new account, please email support@bspsoftware.com

 

Date prompt using in_range function requires showing 1 month automatically

Started by Annon, 16 Jul 2015 01:31:15 PM

Previous topic - Next topic

Annon

Hi, I have a requirement of showing begin date as 16th July 2015 i.e. today's date and end date 16th of June 2015(exactly 1 month less) automatically in prompt page while using filter as [Date] in_range ?Start and End Date? in query. I am using Date prompt in my prompt page and mine is relational data base. It would be a big help if you can come up with some Java or HTML Scripts.

gpollock

You'll use a filter expression to do this.  When editing your query filter, there is a built-in function to add/subtract days.  Use that to always get this day last month.

sacjeanie

I would create two prompts with default values.

Data Item #1 - Today's date = {sysdate} (This is an Oracle function and we have an Oracle DB)

Data Item #2 - Year ago Date = _add_years ({sysdate}, -1) 
                  (or you could use the data item name you used from prompt #1)

There is some oddity on leap years on leap days that you have to take in account.