Create a Query

There are several ways to create a new Query

 The following instructions apply for all these variations.

Create a Query from Scratch

Select the New Object tab.

Or click New on the Object menu.

DBxtra will insert a new Object Tab.

Use the Object wizard

When you click New  on the Object menu at the"Select Connection" window will pop up.

Select the Data connection and double click.

To view all Data connections click the button View All Connections.

Click Cancel if you want to add objects manually.

Tables/Views: Select the database tables / views and double click to add it to the Query.

MS SQL Server Stored Procedures: Select the Stored Procedures double click to add it to the Query.

DBxtra Objects: Select the DBxtra Objects and double click to add it to the Query.

Click Close if you want to add objects manually.

Drag & Drop objects to the Diagram Pane

Select the object from the Project Explorer - Connection - Database and drag & drop it to the Diagram Panel.

Drag and drop database tables / views and DBxtra Objects

Use the right mouse menu to add tables / views and DBxtra objects

You can right click an object and select Add Object.

Use the menu bar to add tables / views and DBxtra objects

To add Tables/Views click the Add Tables/Views on the menu bar.

Select a table and click Add.

To add DBxtra Objects click the Add DBxtra Objects on the menu bar.

Select a DBxtra Object and click Add.

DBxtra will attempt to create a relationship between objects automatically.

By default it will establish the relationship as INNER join.

Add Relationship

To  add a relationship join drag and drop the field to join from one object to the other object field.

Edit Relationship

To edit the relationship settings Double Click  the join line.

To set the join to a LEFT or RIGHT join edit the proper check box.

A INNER join will be presented like this:

A LEFT join will be presented like this:

A RIGHT join will be presented like this:

You can also set an operator for the join.

Add fields to the Query

Select fields to add  to the Query by clicking the check box.

You can also add a field by selecting the object in the "Table" column and the Field in the "Column".

Add Expressions

Add expressions by either "double clicking" the "table" column or by selecting <Expression> in the Table column.

 

You can enter an expression either manually or by double clicking the appropriate field and operator.

Note! DBxtra will allow to enter any expression supported by the database you are connected to.

If your Query is built from more then one database then the MS Access SQL syntax is required.

When finished click Ok and the expression will be entered to the Query.

Date Functions

DBxtra offers many preset Date Functions you can use.

Example! If you need to filter your Query or Report data from only "Last Month", entering a Date Function might be useful.

Note! Date Functions can only be applied to "date" type fields.

To define a filter based on a DBxtra Date Function select the field Criteria and double click it.

Select the Operator and double click the Date Function from Values.

Click Ok.

Every time the Query or Report runs then it will filter data which applies to the defined Date Filter.

Note! Queries with DBxtra Date Functions also apply to Reports and Charts.

If you design a Report based on a Query with DBxtra Date Functions then it will act as such.

DBxtra Date Expressions

If you need to convert a date value into a Year, Month, Week or Quarter value DBxtra will automatically insert the correct expression for you.

Note! This only applies to Database connections to MS SQL Server, MySQL, Oracle and MS Access.

 

Add a new expression.

 

 

Select the table / view and field which holds the date value and click the Expression - Date Function button.

 

 

Select a Date Expression.

 

DBxtra will insert the data expression for you.

 

Watch the Video

 

Convert Expression

If you need to convert a field type to another one then you can use the Convert Expression builder.

This functionality only applies to connections to MS SQL Server, MS Access, MySQL and Oracle databases.

 

Add a new expression.

Select the table and field.

Click Convert Expression.

 

 

Select a field type to convert the expression to.

 

Watch the Videp

Parameter Query

Click here to learn about User Input Parameters

 

Assign Alias Names

DBxtra .NET allows you to assign friendly Alias names to fields.

Once you enter an Alias name it will be shown in all Queries and Reports instead of the real field name.

Assign Sort Order

Select the Sort Type column and assign the sort order either Ascending or Descending.

Change the Sort order in the Sort Order column.

Summarize - Aggregate Function

Group data and add aggregate functions by selecting it from the Group By drop down field.

Change any other Group By aggregate function by selecting it from the drop down field.

Criteria - Filter

Select the field Criteria and double click it.

DBxtra allows to add any criteria supported by the database you are connected to.

Note: If your Query is built from more then one database then the MS Access syntax is required.

To add a operator double click it.

Show Values from database

Click Show Values to load all values contained in the database.

To select a given value double click it.

This will insert the value into the expression.

Click Ok to add the expression to the Query.

Combining Criteria  

Move Rows

Query Properties

Right click inside the Parameter Panel and select Edit.

To select only a certain number of Top Records click the TO" field and enter a value.

Choose between PERCENT and WITH TIES.

Optionally select GROUP BY.

Union Queries

Right click on the Diagram Pane and select Union.

Select New union Sub-Query.

Select the left .

Drop the table or Object to the Diagram Pane.

Select fields to be queried.

Drop the table or Object to the Diagram Pane.

Select fields to be queried.

Click on the Union symbol and select the UNION type

Save a Query

Click Save on the menu.

Select a Folder

Select the folder where to save the Query.

Create a new Folder

You can create a new folder by clicking the New Folder button.

The Query will be saved in the new folder.

Assign a comment

You can also assign a comment for each saved object.

Assign user group privileges

Assign the Query to an existing user groups with privileges to open the object.

Allow Anonymous Access in Report Web Service

This option allows to open a Web report without logging in.

Watch Video

Save As (Save with a different name)

Sometimes it might be useful to save different variations from a Query or Report.

To save a Report with another name click the Save As button. This will create a new object.

Save only as Query

Note! If you save an existing Report object as a new object you have the choice to save only the Query of it and not the Report itself.

To do so check the Save Only the Query option.

Movies

Watch Movies

Related

Create a new Query from various Data Sources

Open a Query