The ability to include (multiple) query parameters directly in Query Titles, and have them correctly evaluated. At the moment they are not; further, if you try to use a function to evaluate them, it either doesn't work - e.g. =ForceText() - OR you get prompted for a seperate instance of the parameter (and not of the required data type).
There is already a request for multiple functions to be supported in Query titles, which this request should be taken in conjuction with.
For example, in a query where parameter ['CutOff'] is used to input a threshold date for record selection, Title: 'Individuals born after ['CutOff'] and still alive at =Today()' doesn't evaluate ['CutOff']. Replacing ['CutOff'] by, for example, =Date(['CutOff']) does evaluate, but only by prompting for a separate instance of the parameter 'CutOff', and then only allows interger data entry, despite the parameter defined in the body of the query being a date.
ID:3043
* Parameters to be supported in Query Titles
- GladToBeGrey
- Famous
- Posts: 115
- Joined: 26 Oct 2004 09:16
- Family Historian: V7
- Location: Dorset, UK
- SimonOrde
- Program Designer
- Posts: 352
- Joined: 18 Nov 2002 10:20
- Family Historian: V7
- Location: Calico Pie
Parameters to be supported in Query Titles
I can't think of an easy solution to this at present. The reason that =Date(['CutOff']) prompts for a separate instance of the parameter 'CutOff' is that the function 'Date' does not take a date as a parameter. It takes up to 3 integers (for year, month, day). Consequently, FH thinks that in this use, you are asking it to prompt for a year number.
FH will use the same prompt for different instances of a parameter in the same query if they use the same label AND are used to request data of the same type. A date is, from a computer's point of view, quite different from an integer (even if the integer is really a year).
If you want to, you can confim this by changing your filter from:
If %INDI.BIRT.DATE% was later than ['CutOff']
to
If %INDI.BIRT.DATE:YEAR% was later than ['CutOff']
In that case, even if you have =Date(['CutOff']) in the title, you will get only one prompt. However, I don't recommend you do that, for reasons that have been covered before - namely, the YEAR qualifier will return NULL for periods and ranges, and consequently is not recommended for use when comparing dates.
For now, I think you just have to live with having to enter the same info more than once when you run the query.
FH will use the same prompt for different instances of a parameter in the same query if they use the same label AND are used to request data of the same type. A date is, from a computer's point of view, quite different from an integer (even if the integer is really a year).
If you want to, you can confim this by changing your filter from:
If %INDI.BIRT.DATE% was later than ['CutOff']
to
If %INDI.BIRT.DATE:YEAR% was later than ['CutOff']
In that case, even if you have =Date(['CutOff']) in the title, you will get only one prompt. However, I don't recommend you do that, for reasons that have been covered before - namely, the YEAR qualifier will return NULL for periods and ranges, and consequently is not recommended for use when comparing dates.
For now, I think you just have to live with having to enter the same info more than once when you run the query.
- GladToBeGrey
- Famous
- Posts: 115
- Joined: 26 Oct 2004 09:16
- Family Historian: V7
- Location: Dorset, UK
Parameters to be supported in Query Titles
Simon, thanks for a prompt reply. I take your point about =Date(); I should have spotted that [rolleyes]
The desire for parameters to be allowed and evaluated in Titles still stands, though ... [smile]
The desire for parameters to be allowed and evaluated in Titles still stands, though ... [smile]