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

  • Thread starter Thread starter Martha
  • Start date Start date
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
 
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.
 
Back
Top