This is your query as displayed it in the post above, I added line breaks to make it easier to read / diagnosis:
Code: Select all
SELECT
"Main"."ID" AS "ID",
"Main"."Name" AS "Name",
"Main"."Section" AS "Section",
"Main"."Nationality " AS "Nationality ",
"Main"."Favorite Food" AS "Favorite Food",
"Main"."Choice of Canteen food" AS "Choice of Canteen food",
"Main"."Availability of choice" AS "Availability of choice",
"Main"."Allergies" AS "Allergies"
FROM "Main" "Main"
WHERE (Favorite Food LIKE 'Pizza')
In the
WHERE clause, you have
NOT placed
Favorite Food within double quotes, which is required since you have elected to use
Mixed Case rather than
UPPER CASE to indicate the column name. Furthermore, you have elected to use a
SPACE as a part of the column name rather than something like an (
underscore )
_ such as
FAVORITE_FOOD.
Therefore, change
WHERE (Favorite Food LIKE 'Pizza') to
WHERE ("Favorite Food" LIKE 'Pizza') .
Additionally, when you wish to use a
LIKE clause, means you want the database backend to find something in the column,
BUT you are not using any special characters to tell the database you want it to
START with
'Pizza', end with
'Pizza', or something else. Therefore, you on the
Criterion line you could have simply entered
Pizza with
OUT a
LIKE clause.
You could try, any of the following, depending in exactly what you want . . . after stating your Base document:
- Click on the Queries icon on the left
- Under Tasks
- Click on the Create Query in SQL View...
- Copy and paste any of the Queries below, depending on what you want to try

- This indicates you only want to find the literal Pizza
Code: Select all
SELECT
"Main"."ID" AS "ID",
"Main"."Name" AS "Name",
"Main"."Section" AS "Section",
"Main"."Nationality " AS "Nationality ",
"Main"."Favorite Food" AS "Favorite Food",
"Main"."Choice of Canteen food" AS "Choice of Canteen food",
"Main"."Availability of choice" AS "Availability of choice",
"Main"."Allergies" AS "Allergies"
FROM "Main" "Main"
WHERE "Main"."Favorite Food" = 'Pizza'
- This indicates it starts with the literal Pizza
Code: Select all
SELECT
"Main"."ID" AS "ID",
"Main"."Name" AS "Name",
"Main"."Section" AS "Section",
"Main"."Nationality " AS "Nationality ",
"Main"."Favorite Food" AS "Favorite Food",
"Main"."Choice of Canteen food" AS "Choice of Canteen food",
"Main"."Availability of choice" AS "Availability of choice",
"Main"."Allergies" AS "Allergies"
FROM "Main" "Main"
WHERE ("Main"."Favorite Food" LIKE 'Pizza' || '%')
- This indicates it ends with the literal Pizza
Code: Select all
SELECT
"Main"."ID" AS "ID",
"Main"."Name" AS "Name",
"Main"."Section" AS "Section",
"Main"."Nationality " AS "Nationality ",
"Main"."Favorite Food" AS "Favorite Food",
"Main"."Choice of Canteen food" AS "Choice of Canteen food",
"Main"."Availability of choice" AS "Availability of choice",
"Main"."Allergies" AS "Allergies"
FROM "Main" "Main"
WHERE ("Main"."Favorite Food" LIKE '%' || 'Pizza' )
- This indicates the literal Pizza may be any place, beginning, middle, end
Code: Select all
SELECT
"Main"."ID" AS "ID",
"Main"."Name" AS "Name",
"Main"."Section" AS "Section",
"Main"."Nationality " AS "Nationality ",
"Main"."Favorite Food" AS "Favorite Food",
"Main"."Choice of Canteen food" AS "Choice of Canteen food",
"Main"."Availability of choice" AS "Availability of choice",
"Main"."Allergies" AS "Allergies"
FROM "Main" "Main"
WHERE ("Main"."Favorite Food" LIKE '%' || 'Pizza' || '%' )
- This indicates search may be any place, beginning, middle, end AND Prompt for desired search string
Code: Select all
SELECT
"Main"."ID" AS "ID",
"Main"."Name" AS "Name",
"Main"."Section" AS "Section",
"Main"."Nationality " AS "Nationality ",
"Main"."Favorite Food" AS "Favorite Food",
"Main"."Choice of Canteen food" AS "Choice of Canteen food",
"Main"."Availability of choice" AS "Availability of choice",
"Main"."Allergies" AS "Allergies"
FROM "Main" "Main"
WHERE ("Main"."Favorite Food" LIKE '%' || :Enter_Search_String || '%' )
I hope this helps, please be sure to let me / us know.
Sliderule
Thanks to add
[Solved] in your
1st post Subject (edit button top right) if this issue has been resolved.