Page 1 of 1

Date ranges on report

Posted: Mon Aug 14, 2006 3:15 pm
by Garry
Hi,

I've used the Questions Wizard to create two date questions when I run a report I've created using the Report Wizard. When the report is run the dates presented are blank and I have to fill them in. I notice in Capital most in built reports prompt you with the date range starting from the first day of last month to the last day of last month. How do I do the same with Visual Builder?

Posted: Mon Aug 14, 2006 3:29 pm
by COBS Tech Support
Load your report/form into the Visual Builder editor. Then from the main menu select Edit|Form Properties. Click on the Questions tab button. Select each question in turn and press Edit.

For the start date the script inside the Variable Declaration box should look like this:

Declare Answer1 Type Date
Answer1 := MonthStart(DateFromMonth(Today(), -1))

(If the variable name in Result In is not 'Answer1' change the above references from 'Answer1' to whatever matches the contents of this field.)

For the end date the script inside the Variable Declaration box should look like this:

Declare Answer2 Type Date
Answer2 := MonthEnd(DateFromMonth(Today(), -1))