Searching on a calculated field

Hello
I have a calculated field, soted, called fullname and it is made from the Firstname MI and Lastname fields. When I try to search i get different results, example if I search #%Brandon% I may get 2 records back, but if I search on the first name field there are 53 records. Same thing if I search on part of the name like this #%Smith% I says no records found, when there are 203 records in the table with that last name. What am I doing wrong? Thanks

drobin:
Hello
I have a calculated field, soted, called fullname and it is made from the Firstname MI and Lastname fields. When I try to search i get different results, example if I search #%Brandon% I may get 2 records back, but if I search on the first name field there are 53 records. Same thing if I search on part of the name like this #%Smith% I says no records found, when there are 203 records in the table with that last name. What am I doing wrong? Thanks

Because of how SQL works on the back end, you’d be better off searching the fields themselves rather than the calculation. I’m guessing that you want to be able to search both the first name and the last name field for whatever is supplied as the search criteria.

You would want to write a method that would search both of those fields with either an AND search or an OR search. This will depend on where the search criteria is entered. You can create a field named searchField and it would then become globals.searchField or you can write a custom find method that when the find was executed your would take the values from the first name and use them in the last name field as well.

Hope this helps. I didn’t have the time to create an example but you might find some understanding from this video.