[Solved] Criteria in query

Discuss the database features
Post Reply
JEROME549
Posts: 3
Joined: Fri Apr 06, 2018 6:06 pm

[Solved] Criteria in query

Post by JEROME549 »

I am new to OpenOffice Base and would like to know how to do the following. I have a database file with a field called "FirstName" and what I want to do is set the criteria in a query to only show First Names that begin with the letter "J". Any help with the syntax would be greatly appreciated.
Last edited by JEROME549 on Sat Apr 07, 2018 12:06 am, edited 1 time in total.
OpenOffice Version 4.1.5 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: criteria

Post by Villeroy »

Create a query in SQL view:

Code: Select all

SELECT * FROM "Table" WHERE "First Name" LIKE :Name_Starts_With || '%' 
replace "Table" and "First Name" with the actual names of your table and column.

In any view of a table, query or form there are filter tools where you can enter something like LIKE 'J*'
In the GUI you can use the usual asterisk * as joker. In SQL it is %
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
JEROME549
Posts: 3
Joined: Fri Apr 06, 2018 6:06 pm

Re: Criteria in query

Post by JEROME549 »

Used the wildcard LIKE ‘J%’ and that solved the problem. Thanks so much for your help.
OpenOffice Version 4.1.5 on Windows 10
Post Reply