4 Replies Latest reply on Mar 18, 2014 12:29 PM by Stephen Huston

    Selecting multiple fields


      Hey guys..


      I have hotels option to stay for Thur, Fri Sat or all. I want to be able to select one or more and reprot the days. How would I be able to report say if I selected Thur and Fri, or Thur and Sat. I know it wouldn't work as an check box set.

        • 1. Re: Selecting multiple fields

          Why would the checkboxset not work?  You can also place the same field (weekday) on the layout and use different valuelists (one with just monday, tuesday etc...)


          What kind of relationship are you using to report or find?

          • 2. Re: Selecting multiple fields

            When I check say Thur and Fri in the check box it would only show one of them on report. I just trying to report the Hotel Name:, Room Type: Customer Name: and the night stay whick is Thur, Fri Sat or All which is the check box set up. It seems to not work good with reporting. The relationship is based on my contacts table.

            • 3. Re: Selecting multiple fields

              That should be "Selecting multiple VALUES". It's time to learn about checkboxes...


              These are a 'format' for a field and use a Value List. Multiple values can be checked/unchecked and the order in which they are checked places the value in the field separated by returns. If you place a copy of the same field on the layout without formatting, you'll see this in action!


              That being said, to "get" the records containing these values as 'checked' (presumably finding and reporting), involves some careful thought. If you try to find: areturnc (which is checking 'a' followed by 'c' in FIND MODE), then you will only match that exact pattern. If you want "a" OR "c", then you must make multiple find requests.

              == example find script ==

              Enter find mode

                   set field ( 'days' ; 'a' )

                   new record/request

                   set field ( 'days' ; 'c' )

                   perform find


              Ok that probably gets you the correct records (with "a" or "c"), but sorting on the field? Oh yes, you run into the same problem as with find. It's looking at the exact pattern of the text (including returns) in the under-lying field!


              Then there is the ability to use an ExecuteSQL query to find what you wanted, but again difficult to sort or report on the field "as is".


              Keep in mind, this will NOT let you show the Room more than once on a report, as it's one record. This is where you need to do some redesign and add a "join", so that you have distinct relationship between each "check" (day) and the room (thus allowing you to have the same room reported on each day). This probably is not a simple checkbox-formatted field on the record any more. Think about what information you need, see if you can find other reservation examples (or even calendars) that might point you to ways to design for easy entry AND nice reporting.




              • 4. Re: Selecting multiple fields
                Stephen Huston

                Another option for for reporting would be to set a global variable (or global field) -- if you are reporting only one record at a time -- to the value of the checkbox, with spaces substituted for the returns in the checkbox field. Then use that $$variable or global field on the reporting layout.


                If you need to report multiple reservations at a time, you will need a non-global field to capture the data from the checkbox field for each record.


                Sample calculation:

                • Substitute ( checkboxfieldname ;  "¶" ; " " )

                That will remove the carriage returns and insert single spaces so you can report it on a single line.