I have a Truck Trailer leasing App I wrote a few years ago that has a Unit table (Trailers) that has about 30 fields that define the trailer. Things like: make, model, length, year, type of doors, type of roof, weight, axles, etc. In recent years I added a Unit Properties table where they can add & define other descriptive fields and their valid values. This table obviously can have many entries for each Unit and I only save records in this table where the user has entered a value. These are presented in a scrollable list on the Unit form. I did this so I wouldn’t have to change the Unit table every time they came up with something new to define the Unit.
When reporting on these units I let them select the fields and the properties they want to print and create a custom format from the default report on the fly. The reporting screen allows them to enter “Filter” conditions for the Unit fields. I use those to build a Where clause for the Select statement using the “AND” operator for the selected fields.
Now it’s time for an update and they want to add more fields or properties that only apply to certain types of trailers. I’m thinking I should change most of the fields into properties. This wouldn’t be too hard to do, but I’m worried about how to do the Select on the Unit table with a join to the Unit Properties table where I need to use the “AND” on the properties to get the results I need. An example would be I need a 48 foot trailer with side doors not more than 5 years old and not currently on lease. I could use an “OR”, but then I would have to do some more processing after the initial Select to get the individual Units and the properties into one record. I haven’t used pivot tables much, is that a possible solution? Looking for some guidance on the table setup as well as the reporting procedures.
Auguy
Northwest Ohio
When reporting on these units I let them select the fields and the properties they want to print and create a custom format from the default report on the fly. The reporting screen allows them to enter “Filter” conditions for the Unit fields. I use those to build a Where clause for the Select statement using the “AND” operator for the selected fields.
Now it’s time for an update and they want to add more fields or properties that only apply to certain types of trailers. I’m thinking I should change most of the fields into properties. This wouldn’t be too hard to do, but I’m worried about how to do the Select on the Unit table with a join to the Unit Properties table where I need to use the “AND” on the properties to get the results I need. An example would be I need a 48 foot trailer with side doors not more than 5 years old and not currently on lease. I could use an “OR”, but then I would have to do some more processing after the initial Select to get the individual Units and the properties into one record. I haven’t used pivot tables much, is that a possible solution? Looking for some guidance on the table setup as well as the reporting procedures.
Auguy
Northwest Ohio