2 Replies Latest reply on Sep 10, 2007 3:05 AM by oicram

    Advanced Search Form - Drop-Down values

    oicram
      In the insert page: People introduce the birth date of the dog.<br /><br />In the search page:<br />I have a pulldown menu with the values "Baby"; "Young"; "Adult" and finally, "Oldies".<br />For each of this values I will need to have a range:<br /><br />Baby - until 6 months.<br />Young - From 6 Months until 3 years.<br />Adult - From more then 3 until 8 years.<br />Oldies - more then 8 years. <br /><br />I have a SQL script that gives me the Age in years:<br />SELECT CURDATE(), (YEAR(CURDATE())-YEAR(data_nasc_an)) - (RIGHT(CURDATE(),5)<RIGHT(data_nasc_an,5)) AS Age<br /><br />The problem is that if the little dog as less then 12 months he will return 0. This will be not a big issue, but dogs grow a lot in the first year, so we cannot put a dog with 2 months and a dog with 11 months like being the same.<br /><br />1) How can we show the age in a way that the first year can be show in months?<br /><br />2) How can we, for this case of Age, get a range of values associated with the combo box?<br /><br />I have ADDT but i've never use Query Builder. I have read a little about it in the documentation but I have no clue if he can help me with this.<br /><br />This post was parcialy posted in Dreamweaver forum, but since I'm using ADDT and that ADDT may have a solution for this, I've post it here also.<br /><br />Thanks and I REALLY need some help here. :S
        • 1. Re: Advanced Search Form - Drop-Down values
          Günter Schenk Level 4
          Hi Marcio,

          yeah, I´ve already seen your thread on the Dreamweaver forums, and the brilliant solution posted by David Powers seems way to go -- I actually couldn´t give you any other tip here.

          >>
          I have ADDT but i've never use Query Builder. I have read a little about it in the documentation but I have no clue if he can help me with this
          >>

          ADDT´s Query Builder isn´t made for creating such weird stuff :-) Really, this is a very complicated scenario which will always require manual coding

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Advanced Search Form - Drop-Down values
            oicram Level 1
            Ok. I will try to change in the code with the script given by David.

            I will post back future issues on this, in the post made in dreamweaver forum.

            Thanks again.