Compose queries to retrieve information from your database not accessible through standard reports.
In the Main Menu, click Reports, User Query.
See our QuickTip video Find and Run a Query in Open Dental.
Users must have the User Query permission to run and change variables in released user queries.
Users must have the User Query Admin permission to write, edit, run, save, and delete queries.
Text Box: Displays the query text. If you have User Query Admin permission, you can enter text directly in this box. If you do not, it is disabled.
Favorites: Open Query Favorites.
Add to Favorites: Add the query text currently in the text box to Query Favorites.
Copy: Copy the query text in the text box to the clipboard.
Paste: Paste any text currently on the clipboard into the text box.
Submit Query: Run the query text currently in the text box. When long queries are run, the Submit button will change to Stop Execution. Click to cancel a large query that may take a long time to run.
Format: Select how to view the results.
- Human-readable: This is an easy to read format. Some column names that are used in our tables may display as follows:
- Dates may be converted to standard format.
- Dollar amounts may receive the extra zeros and be right aligned.
- Enumerations may convert (built-in lists like areas of the mouth, patient status, gender, etc.).
- Definitions linked to the definition table get converted.
- Provider numbers will show the provider's abbreviation.
- Patient numbers will show patient name.
- True/false: Boolean values will show true/false.
- Raw Format: In this format, the results are not as easy to read, for example there may be meaningless numbers or no extra zeros on dollar amounts.
Title: The title of the query in the text box, if one exists.
By default the results will display in human-readable format. If a column header is prefaced with a $, the cells are always formatted as a dollar amount.
To more easily view the query results, there are a few display options.
Once the table displays the way you want it, there are several options:
- Print Preview: View the query like a printed report. Some columns will show a grand total at the bottom of the report while in preview mode. You can Zoom in or use the blue arrows to scroll through pages. Click Query View to return to regular query view.
- Print: Print the query to the default printer.
- Export: Save the file as a tab delimited txt or xls file to use in another program (e.g. Microsoft Word or Excel). Typical uses include letter merge, spreadsheet analysis, or financial imports. Set the default folder for exported queries in Data Paths Setup (OpenDentalExports).
- To include a title/header on printed query results, save the query to your Query Favorites, and enter the title. Then, run the query again.
- Advanced users can run queries directly on the database from outside programs using ODBC or other methods.
- To also run command queries, user must also have the Command Query permission.
- If using Random Primary Keys, queries with CREATE TABLE or DROP TABLE syntax can only run on the computer named as the User Query Server on the Replication Setup window (Replication).
Find a Query
- Query Favorites: Access a customizable list of queries that are used often in your practice. Designated users can only run released queries. User Query Admin permission is needed to add, edit, and delete query favorites, as well as control which queries can be run by others.
- Query Examples: Search through more than 1000 queries that have been commissioned by our customers, then copy/paste into Query Favorites or the Query window.
- Custom Queries: For a fee, Open Dental can write custom queries for you. You must currently be on support.
- Write your own query, then run and/or save it to your favorites.
Security: Access to queries is controlled by user Security Permissions.
- User Query: User can only run released queries from the Reports, User Query submenu.
- User Query Admin: User can run queries, and edit, add and delete query favorites.
- Command Query: User can run SQL commands (non-select queries)
Programming Resources, Database Documentation has a list of tables and columns in the Open Dental database.