Query - Study (studyquery)
|Top Previous Next|
Study queries are used by studies and extract the collision records from the database for analysis. Study queries require a single record be returned for each collision. The Crash Magic query editor allows fields from the query to be identified as normalized fields. Normalized fields are query fields that are mapped to the Crash Magic program. These fields tell the program when and where a collision occurred. Crash Magic uses the normalized fields to add where clauses information to the study query. Depending on the collision data in use some or all normalized fields will be used. Study Definitions are used to define which fields will be used when a new study is created.
Normalized fields are selected in the query editor using the Normalized field drop down menu.
Clients that use the Map Magic selection tool will need to join the CID Crash Magic system table with the collision data. This generally requires that both the crash data and system tables reside on the same SQL server.
Study queries must have an order by clause. An order by clause will assure the database returns the records in the same order each time the query is performed. Without an order by clause the clients using collision diagrams may experience problems when moving collision graphics in a diagram. The id field or fields for the collision record should be selected for the order by clause. This field or fields are also used as the _CaseID field with in the calculated fields.
Where clauses should be avoided with study queries as they will be dynamically added to the query by the study definition.
If multiple study queries are required every effort should be used to use the same fields in the select statement of each study query and the ClickOn query.