Product: LABELVIEW, CODESOFT
Version: All Versions
|
About Queries
What is a query?
A query is a request for information. By creating a specific request, you are able to extract from the database only the data that you want to include on your label.
Working with queries
A query applies to a single data source. Because of this, you must select the ODBC data source to be queried before constructing the query itself. Changing the data source cancels any previously created query.
Your query defines the tables and fields in the database that you want to include. You can refine the query by defining joins and filters. Once it is defined, you can run the query and display the result before including it in your document. When you are sure the result contains the required data, you can add database variables to your document as text, bar code and—when appropriate—image objects.
Selecting a Sort Order
Sort order
Once you have selected the fields that you want to include in your label, you can sort the records as follows:
- Ascending sorts text in alphabetical order, numbers in numerical order, and dates and times in chronological order.
- Descending sorts text, numbers, and dates and times in reverse alphabetical, numerical and chronological order, respectively.
You assign a sort order to a field. For example, assigning Ascending to a Name field sorts the names in alphabetical order.
Sort keys allow you to apply a sort order to several fields, and specify the order in which the sorts take place.
For example, if you apply an ascending sort to a Color field first, and apply a second ascending sort to a Lot Number field, the records are sorted by color and then by lot number, as follows:
If you applied the sort order to the Lot Number field first, this would be your result:
Procedure
To select a sort method:
Displaying Query Results
Query results
To display the results of a query, you must have a document open, and you must have run (merged) a query in that document. The query fields appear under Database in the Data sources window.
Procedure
To display query results:
Searching Query Results
Search options
You can search for a specific field, specific data, or both.
Procedure
To search for data in the Query result grid:
- Find first occurrence:
- Find previous occurrence:
- Find next occurrence:
- Find last occurrence:
Printing Query Results
Print options
The print options allow you to print labels for selected records.
Procedure
To print labels from the Query result dialog box:
Closing and Saving a Query
About closing
Closing a query removes it from the current document, but does not delete it from its file storage location.
When you close a new or edited query, or when you close a document that contains a new or edited query, you will be prompted to save the query.
Procedure
To close a query:
NOTE: The path to the default working folder is defined in the Default folders tab of the Options dialog box, accessible from the Tools menu. The query is closed and removed from the Data sources tab of the Document Browser.
|