Converting MS Access Query to OpenOffice Base Query

Creating tables and queries
Post Reply
mciverp2
Posts: 3
Joined: Tue Sep 07, 2021 12:47 pm

Converting MS Access Query to OpenOffice Base Query

Post by mciverp2 »

My new query doesn't run. I don't get an error, it just does nothing. It's suppose to match a name anywhere in a field where the name is entered. The query reads: "LIKE '%' || :Enter_name || '%'"
Last edited by MrProgrammer on Tue Sep 07, 2021 7:20 pm, edited 1 time in total.
Reason: Moved topic from Beginners forum to Base
OpenOffice 7.2 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Converting MS Access Query to OpenOffice Base Query

Post by Villeroy »

The complete statement looks like this:

Code: Select all

SELECT * FROM "TableName" WHERE "TextFieldName" LIKE '%' || :Enter_name || '%'
Replace TableName with the name of your table and TextFieldName with the name of your text field.
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
mciverp2
Posts: 3
Joined: Tue Sep 07, 2021 12:47 pm

Re: Converting MS Access Query to OpenOffice Base Query

Post by mciverp2 »

Did as instructed and received the following:


"The data content could not be loaded. The query can not be executed. It is too complex"
OpenOffice 7.2 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Converting MS Access Query to OpenOffice Base Query

Post by Villeroy »

To which kind of database is your Base document connected? See status bar or menu:Edit>Database>Connection type...
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
mciverp2
Posts: 3
Joined: Tue Sep 07, 2021 12:47 pm

Re: Converting MS Access Query to OpenOffice Base Query

Post by mciverp2 »

It was previously a MS Access DB, but it's been imported in a new BASE DB from a spreadheet.
OpenOffice 7.2 on Windows 10
User avatar
robleyd
Moderator
Posts: 5085
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Converting MS Access Query to OpenOffice Base Query

Post by robleyd »

Base is not a database, but an interface to databases of many types. As Villeroy suggested, tell us what database you are actually using.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Converting MS Access Query to OpenOffice Base Query

Post by Villeroy »

robleyd wrote:Base is not a database, but an interface to databases of many types. As Villeroy suggested, tell us what database you are actually using.
Just like MS Access. Unfortunately, most Access users don't understand MS Access.

@mciverp2
I guess, you dumped all data from Access into Excel sheets and connected a Base document to the Excel document. This is a connection to a pseudo-database.

Try this on a Windows machine:
File>New>Database...
[X] Connect to existing database
Type: MS Access
Point to your Access database file.

Now you can work with that database in the context of this office suite and still use MS Access as well.
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
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Converting MS Access Query to OpenOffice Base Query

Post by Villeroy »

If you want to apply the above mentioned query to your spreadsheet copy of a database, there is a way to do that. The generic database drivers for sheets and text files don't know the concatenation operator ||. They have a concat function which accepts only 2 arguments.
http://www.openoffice.org/dba/specifica ... tions.html

Try this:

Code: Select all

SELECT * FROM "TableName" WHERE "TextFieldName" LIKE CONCAT('%',CONCAT( :Enter_Part_Of_Name, '%' ))
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
Post Reply