Archive for January 2018
Advanced Database – Create, run a query to show unmatched records in related tables.
Again, there is no automatic way to do this in Base, unlike Access. The only way to do it is to use a subtract join which we covered in the relationships section. As a reminder, let’s set a new one up. Open the Mechanics folder and add a new staff member. Let’s say we want…
Read MoreCreate, run a query to show duplicated records within a table.
There is no easy way to do this in LibreOffice Base. We have to use a roundabout solution. First create a duplicated record by adding a record to the Mechanics table, repeating the first name and grade under a different staff number. This could happen in real-life as an admin error. Close the table. Create…
Read MoreAdvanced Database – Create, run a crosstab query
A crosstab query involves creating a cross join between two tables, where every record of the left table is combined with every record in the right-hand table. Create a new query in design mode and add the tables Orders and Parts. Select to display all fields from both tables. Create a Cross join by dragging…
Read MoreAdvanced Database – Create, run a query to save selected data as a new table.
Imagine we want to copy all of the records with a job number of 10 and above from the ‘Jobs’ table into a new table called ‘Recent Jobs’ Of course, we could do this manually by creating a new table and entering the data records one by one. This is time consuming, so we prefer…
Read MoreAdvanced Database – Create, run a query to delete records in a table.
Imagine we wanted to delete the last 3 jobs from the ‘Jobs’ table as the customers cancelled last minute. We could go through and manually delete them, but imagine if we had hundreds of records to delete (maybe we archived them somewhere else). This would take a long time. We can use the DELETE SQL…
Read MoreAdvanced Database – bound control properties
Apply, remove bound control properties like: limit to list, distinct values. Limit to list and distinct values options are only available in MS Access, not Libreoffice Base. Limit to list changes the properties of a combo box to only allow values from the list. To do this in Base, you simply need to select the…
Read MoreAdvanced Database – Create, run a query to append records to a table.
Appending records means taking them from one table and putting them into another. In MS Access there is a built-in function to do this, but in Base you will have to use an SQL query. Imagine we want to create an archive system for completed jobs. To start with, create a new table called New…
Read MoreAdvanced Database – Create, run a query to add records to a table.
To add records to a table in Base you must use an SQL statement, using the command INSERT. Go to Tools->SQL and in the SQL Command box type: INSERT INTO “Jobs” VALUES (’18’, ‘105’, ‘Repair handbrake’, ’17th JAN 17′, ‘RS1’) Notice that the command inserts a record that includes all 5 fields in the same…
Read MoreAdvanced Database – Create, run a query to update data in a table.
Open the Order Details table. If we notice that there is an error with certain data, sometimes it is easy to change it using the ‘Update’ command. Imagine we notice that Part Ref ‘D1’ (spark plugs) can only be bought in packs of 10, but many records show less than 10 – a human error.…
Read MoreQueries in LibreOffice Base compared to MS Access
Many of the ‘action’ queries that we are going to look at in this section differ in the way that they are executed between MS Access and LibreOffice Base. Queries that directly update, add to, append or delete records in a table can be done without using SQL code in MS Access, by using certain…
Read More