How to assign an Autosearch variable when using calculated fields?
Greets:
I have two calculated fields: Extract(Month from DOB) and Extract(Day from DOB). In the Query Designer the first has a field alias of BirthMonth and the second of BirthDay. In the Query designer, to search them, the Query designer assigns the full expression as the Field name. If I change the Field name to the alias I get an error.
When the report runs, both search values show up as "DOB" and that's all. Since they have the same name, how do I differentiate between them? I need to be able to assign the values to the two AutoSearch variables. When using AutoSearchByName() I've tried the full expression and/or the alias. Neither seems to work. Using DOB does work. However, since I have two search variables, how do I differentiate between them?
Phil Frank
I have two calculated fields: Extract(Month from DOB) and Extract(Day from DOB). In the Query Designer the first has a field alias of BirthMonth and the second of BirthDay. In the Query designer, to search them, the Query designer assigns the full expression as the Field name. If I change the Field name to the alias I get an error.
When the report runs, both search values show up as "DOB" and that's all. Since they have the same name, how do I differentiate between them? I need to be able to assign the values to the two AutoSearch variables. When using AutoSearchByName() I've tried the full expression and/or the alias. Neither seems to work. Using DOB does work. However, since I have two search variables, how do I differentiate between them?
Phil Frank
Comments
ReportBuilder ties its report parameters closely with the autosearch feature. I highly recommend creating report parameters for each of your search conditions and giving them unique names so they can be differentiated in the Autosearch dialog. You can then assign the parameters to the search conditions in the query designer. See the following article on the basics of using report parameters.
http://rbwiki.digital-metaphors.com/end-user/fundamentals-end-user/report-parameter-fundamentals/
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com