[Solved] Simple query question

Creating tables and queries
Post Reply
ibtexn
Posts: 3
Joined: Tue Mar 07, 2017 6:50 pm

[Solved] Simple query question

Post by ibtexn »

I am working with local cemetery to digitize there information. I have created a table that contains first, middle, last. dob. dod, section, and plot number.

i want to be able to query information by section but only the section i want. in another database i use to use something like " =[ section] " and when the query ran a dialog box would pop up and you would type "section 1" and the list of section 1 info is all you would get.

any help would be greatly appreciated

Randy


it has been along time since I have messed with any of this
Last edited by Hagar Delest on Tue Mar 07, 2017 11:00 pm, edited 1 time in total.
Reason: tagged [Solved].
newbie OpenOffice 3.1 on Windows10
User avatar
Sliderule
Volunteer
Posts: 1278
Joined: Thu Nov 29, 2007 9:46 am

Re: simple query question

Post by Sliderule »

Welcome to the OpenOffice / LibreOffice Base forum.

Based ( pun intended ) on the limited information you gave . . . you can use the following Query to return a result set with a Pop-Up that will allow you to enter the search criteria you want.

Code: Select all

Select 
   "MY_TABLE".*
From "MY_TABLE"
Where "section" = :Enter_Section_Desired
Explanation:
  1. You will have to change the name of the table I entered above ( "MY_TABLE" ) to the exact table name you have defined. AND, the TABLE NAME must match by case ( CASE: UPPER, Mixed, lower ) exactly, since, "MY_TABLE" is not the same as "My_Table" nor "my_table" .
  2. You will have to change "section" to the exact name you have defined in your table.
  3. Use of the :Enter_Section_Desired clause indicated the characters displayed to the user, and, whatever the user enters, must match exactly the data content in the column. That is the database will return all records that match the criteria the user defined.
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.
ibtexn
Posts: 3
Joined: Tue Mar 07, 2017 6:50 pm

Re: simple query question

Post by ibtexn »

does all that go in the criterion field of the query?
newbie OpenOffice 3.1 on Windows10
User avatar
Sliderule
Volunteer
Posts: 1278
Joined: Thu Nov 29, 2007 9:46 am

Re: simple query question

Post by Sliderule »

According to your post, you are using OpenOffice 3.1, that is an extremely old version. The current version is OpenOffice 4.1.3 . Please upgrade to the current version, or, correct your forum user profile.
  1. If you are creating the Query using the code I gave you above, you can copy and paste it, after:
    1. Start your OpenOffice / LibreOffice Base file ( *.odb )
    2. Click on Queries icon on the left
    3. Under Tasks, click on: Create Query in SQL View...
    4. Copy and paste the code
    5. To run the Query, Press the F5 key, OR click on the Run Query (F5) icon
  2. If you want to enter it using the GUI ( Graphic User Interface ), on the Criterion line, under the column in question, enter :Enter_Section_Desired
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.
ibtexn
Posts: 3
Joined: Tue Mar 07, 2017 6:50 pm

Re: simple query question

Post by ibtexn »

Thank you very much...
newbie OpenOffice 3.1 on Windows10
Post Reply