Issue
Some complex queries are easier to achieve, to filter your collision records effectively, by performing a simpler query on a sub-set of the records.
Solution
The solution to simplify your queries, is sometimes to perform what is effectively a nested query, or a query on a query. This kind of query can be very complex to define and, whilst the advantages of the Query Wizard in KeyACCIDENT, which provide a simple way to define queries, is clear, this can sometimes limit what can be achieved. You do, of course, have the option to enter full Structured Query Language (SQL) queries, a rich knowledge of SQL will be required to be sure this is effective.
The best means for this is to export the results of a query and to add this as a new database in its own right.
Note - To do this you will need to have an empty (or temporary) database into which to take the collisions from the first query. If you don’t have such a blank database it is very easy to create one, you just need to have the master username and password for the instance of SQL Server you are working with. This may require the administrator of the server to help.
Once you have performed your query for the first ‘wave’ the results can be written to a file using the ‘Export’ step (as shown). The format that should be selected for this purpose is the KAML file. Once you have exported the collisions to the file, you can switch to the blank database, and use the ‘Add Records’ screen as normal to add the records in to the blank database for further query.
Please note that this method to export accidents can be used for a variety of other purposes, for example to backup (and restore) accidents, or for when you wish to remove historical records for archiving. It can also be a way to transfer records to external organisations.