I need creating a query to show the Cost results from the general

M

Martha

I am creating a query to show the Cost results.

I am using the following tables:

General Table Size Mat desc Type Ins Thickness and Calc.
Size(key) Desc (key) Type(key)
IDTIT (key) Calc, Quantity, Total

The SQL script for the query is as follows:

SELECT Calc.Size, Calc.Desc, Calc.Type, Calc.[Ins Thickness], Calc.Cost,
Calc.Quantity, [Cost]*[Quantity] AS Total
FROM TablaGeneral INNER JOIN Cost ON [TablaGeneral].[Cost]=Cal.Cost
WHERE Tabla General.cost=Calc.Cost;

I need this query to show the file Cost of those who
have not attended from the General Table. It has no valor at all in the
"cost" field of
the "Calc" table.
Thanks for help me
Martha
 
K

KARL DEWEY

General Table Cal.Cost
TablaGeneral Calc.Cost
Tabla General
What is the actual name of the table?
By the way if you use a space in a table or field name you must use brackets
around the name.

How do you expect to get 'Cost results' when there is no cost VALUE stored
in the table?
FROM TablaGeneral INNER JOIN Cost ON [TablaGeneral].[Cost]=Cal.Cost
You do not join a table (TablaGeneral) to a field (Cost).
You would use --
FROM TablaGeneral INNER JOIN Cal ON [TablaGeneral].[Cost]=Cal.Cost

But if there is no value as stated above then there would not be a match of
any records and therefore no results.
Which ever table has cost needs to be LEFY join to the other on the Cost
fields and the WHERE statement have the Cost field without values equal Null.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top