[Solved] Create query to show clients from specified city

Creating tables and queries

[Solved] Create query to show clients from specified city

Postby RosarioCarrillo » Thu Dec 05, 2019 8:07 am

I have no idea what i am doing i have the next 4 days to do my project and its frustrating because i feel like I'm close to understanding and i do what i need to but then it doesn't work !!!! So i need to do a table my question is do i have to add a description to the table in the design mode. Also when i am doing the query i feel like i get it but then nothing i do works i just need the clients info for a specific city and how i do it on query only works until i run it then it shows me an empty table and it allows me to add info but only one record nothing more what can i do to fix it ?????
Last edited by Hagar Delest on Fri Dec 06, 2019 11:56 pm, edited 2 times in total.
Reason: tagged solved
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: I need help

Postby keme » Thu Dec 05, 2019 9:09 am

Don't fear the punctuation!

I assume that this is a school project. We will not do it for you, but if you give more details about the assignment, you may get sensible advice.

Also, if you share your "work in progress" with us, we can see where you have gone wrong. This enables us to provide even better advice. If it is a job assignment, it may contain confidential info. In that case, don't share. This is a public place.
User avatar
keme
Volunteer
 
Posts: 3343
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: I need help

Postby RosarioCarrillo » Thu Dec 05, 2019 10:20 am

Basically what my professor is asking is to make two table for two different types of data and i did that.. But then he ask to do a query for one of the data that has client info and its asking to to make the query that only shows the clients only from a specific city
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: I need help

Postby floris v » Thu Dec 05, 2019 10:57 am

You can use the "where" statement to list only the data from records thet meet the condition, like "where <field name> = value". You should be able to figure this out without help though.
AOO 4.1.6 op Linux Mint
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
floris v
Moderator
 
Posts: 4203
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: I need help

Postby RosarioCarrillo » Thu Dec 05, 2019 11:07 am

alright so when i put that in and this comes in

Attempt to insert null into a non-nullable column: column: Street table: Client in statement [INSERT INTO "Client" ( "Billed ","City ","Client Name ","Client Number","Paid") VALUES ( ?,?,?,?,?)]
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: I need help

Postby RosarioCarrillo » Thu Dec 05, 2019 11:09 am

this what i have on my SQL

SELECT "Client Number" AS "Client Number", "Client Name " AS "Client Name ", "City " AS "City ", "Billed " AS "Billed ", "Paid" AS "Paid" FROM "Client" WHERE "City " = 'Where <Anderson> = Value'
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: I need help

Postby floris v » Thu Dec 05, 2019 11:22 am

Try WHERE "City" = "New York". And check the syntax, and please intelligently read suggestions made here.
AOO 4.1.6 op Linux Mint
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
floris v
Moderator
 
Posts: 4203
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: I need help

Postby keme » Thu Dec 05, 2019 11:32 am

The "non nullable" messages typically occur when you have a primary key (value is always required for primary keys) and you don't specify a value for it, and also didn't set it to autovalue/autoincrement.
User avatar
keme
Volunteer
 
Posts: 3343
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: I need help

Postby RosarioCarrillo » Thu Dec 05, 2019 11:33 am

how do i fix that? would i need to go back to the table and edit it there?
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: I need help

Postby keme » Thu Dec 05, 2019 1:41 pm

RosarioCarrillo wrote:how do i fix that? would i need to go back to the table and edit it there?

It depends on how your table is set up. First determine what to fix, then we can talk about how.
  • Do you have a primary key (PK)?
    • What data type is it?
    • Did you set it up yourself, or was an "ID" PK created by default when you saved your table?
    • Do you explicitly assign a PK value in the query?
    • Is a value implicitly assigned (e.g. by autoincrement)?
  • Do you have other fields explicitly designated as "not null"?
    • Why?
User avatar
keme
Volunteer
 
Posts: 3343
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: I need help

Postby Hagar Delest » Thu Dec 05, 2019 3:23 pm

keme wrote:Don't fear the punctuation!

Excellent. :lol:

I would add: please provide your topic a real title. If you're here, we bet you're seeking some help.
A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply
AOO 4.1.7 on Xubuntu 20.04 and 4.1.5 on Windows 10 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 28892
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: I need help

Postby RosarioCarrillo » Thu Dec 05, 2019 5:36 pm

Alright thank you I wouldn't be asking for help if I didn't need it I'll get all that info later right now I have to work thanks for all the help much appreciated!
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: Create query to show clients from specified city

Postby RosarioCarrillo » Fri Dec 06, 2019 6:47 am

Im in college and when i ask my professro if im even doing it right if he can explain he just wont he gives me one worded responses and its frustrating.
Attachments
JMSTechWizard..odb
This is what i have so far im still lost if you guys can nudge me to right direction that would be great.
(7.26 KiB) Downloaded 29 times
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: Create query to show clients from specified city

Postby RosarioCarrillo » Fri Dec 06, 2019 7:03 am

This is a quick update but im still stuck and i dont understand what i am doing wrong.
Attachments
JMSTechWizard..odb
update
(7.29 KiB) Downloaded 27 times
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: Create query to show clients from specified city

Postby RosarioCarrillo » Fri Dec 06, 2019 7:20 am

So for primary key, when i started my table i picked my Client Number to have the primary key and all options are on TEXT VARCHAR . None of it is on NULL well i dont think it is . I dont know how to add a pk to query so im not sure if i did it or not. i I also dont know what is autoincreatment .
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: Create query to show clients from specified city

Postby RosarioCarrillo » Fri Dec 06, 2019 9:03 am

So I had help from another source but thanks everyone for the help.
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am

Re: Create query to show clients from specified city

Postby RosarioCarrillo » Fri Dec 06, 2019 9:05 am

https://youtu.be/mKCGJQTe5fs


The source i refrenced too.
OpenOffice 3.1
RosarioCarrillo
 
Posts: 11
Joined: Thu Dec 05, 2019 7:58 am


Return to Tables & Queries

Who is online

Users browsing this forum: No registered users and 1 guest