5 Replies Latest reply on Jan 27, 2010 7:16 AM by daveealex

    Search by age range



      Search by age range


      I have read some of the post about this, and none are what i need. The new request feature does not work to get all the records with ages between 20 and 30. It only gives me the people who are 20 and the people who are 30. When I search i need to find all records with ages between 20 and 30(for example). It could be 26 to 31. It needs to vary. I tried to follow the guide on searching between 2 dates and when i use the calculation it gives me an error. Yes i did change the info to match my database. So I gave up and now I am asking for help. My table name is adl and my age field is adlAge(the age is calculated from the dob). I hope someone has a simple calculation for this. Thank you

        • 1. Re: Search by age range
          Steve Wright

          Hi Dave


          How are you performing the search are you using for instance


          01/01/1970 ... 01/01/1980 or are you doing it on the age field such as


          20...30  (which should include all ages between such as 22, 25, 28) 



          • 2. Re: Search by age range

            Enter Find mode and type this into the Age field:





            A more efficient way (assuming your Age field is an unstored calculation) would be to search the DOB field for dates between 30 years ago and 20 years ago.

            • 3. Re: Search by age range

              Thank you for your Question it gave me the answer. I was not searching like 20...30. I did not know i could search like that, but I would like to have a button that is clicked and it asks what age range would you like to search? or something similer to that. Thank you


              • 4. Re: Search by age range
                Steve Wright

                You have a few options.


                If the age ranges are specific, place buttons for each range [0-16] [17-21] [22-30]  etc

                Add the range as a script parameter to the button, i.e  "0..16" 


                Make a script which then performs the search, using get(ScriptParameter) 


                Or, you could add two global fields for start / end either allow entry into these fields with a button to search

                or display a custom dialog box, using these fields


                The script would then combine the fields as the basis of the search


                g_age_start &"..."& g_age_end



                • 5. Re: Search by age range
                     SW and comment, thank you both for your help!!