problem adding new columns

  • Thread starter bigwillno2 via AccessMonster.com
  • Start date
B

bigwillno2 via AccessMonster.com

i am having problem adding a new column to my main query. somehow, everytime
i try to add a new column i loose everything. with the current columns, i get
the data, it works, but when i try to add something else it give me a syntax
error on JOIN operation. this is the query statement that i have.

SELECT MSM.ModelNumber, MSM.Desc1, MSM.Desc2, Spring.Spring, Label.Label,
Size.Size, Needle.Needle, Pattern.Pattern, Config.Config, Border.Border, MSM.
Produce, Concatenate("SELECT Qfill FROM qrQfills WHERE ModelNumber = """ &
[MSM].[ModelNumber] & """") AS Qfill, Concatenate("SELECT Bfill FROM qrBfill
WHERE ModelNumber = """ & [MSM].[ModelNumber] & """") AS Bfill, Concatenate
("SELECT UphFill FROM qrUphfills WHERE ModelNumber = """ & [MSM].[ModelNumber]
& """") AS Uphfill, Concatenate("SELECT PtFill FROM qrPtfills WHERE
ModelNumber =""" & [MSM].[ModelNumber] & """") AS Ptfill
FROM [Size] INNER JOIN (Pattern INNER JOIN (Needle INNER JOIN (Label INNER
JOIN (Config INNER JOIN (Border INNER JOIN (Spring INNER JOIN MSM ON Spring.
SpringID = MSM.SpringID) ON Border.BorderID = MSM.BorderID) ON Config.
ConfigID = MSM.ConfigID) ON Label.LabelID = MSM.LabelID) ON Needle.NeedleID =
MSM.NeedleID) ON Pattern.PatternID = MSM.PatternID) ON Size.SizeID = MSM.
SizeID;

this above works fine....but i am trying to add, FoamCore, FoamEnc, BoxType
and BoxProfile, that are from new table related to a main table(MSM) by
FoamCoreID, FoamEncID, BoxTypeID, BoxProfileID and it does not allow me to do
it. am i breaking some type of rule in SQL or something. Bellow is my attempt.


SELECT MSM.ModelNumber, MSM.Desc1, MSM.Desc2, Spring.Spring, Label.Label,
Size.Size, Needle.Needle, Pattern.Pattern, Config.Config, Border.Border, MSM.
Produce, Concatenate("SELECT Qfill FROM qrQfills WHERE ModelNumber = """ &
[MSM].[ModelNumber] & """") AS Qfill, Concatenate("SELECT Bfill FROM qrBfill
WHERE ModelNumber = """ & [MSM].[ModelNumber] & """") AS Bfill, Concatenate
("SELECT UphFill FROM qrUphfills WHERE ModelNumber = """ & [MSM].[ModelNumber]
& """") AS Uphfill, Concatenate("SELECT PtFill FROM qrPtfills WHERE
ModelNumber =""" & [MSM].[ModelNumber] & """") AS Ptfill, FoamCore.FoamCore,
FoamEnc.FoanEnc, BoxProfile.BoxProfile, BoxType.BoxType
FROM BoxType INNER JOIN (BoxProfile INNER JOIN (FoamEnc INNER JOIN (FoamCore
INNER JOIN ([Size] INNER JOIN (Pattern INNER JOIN (Needle INNER JOIN (Label
INNER JOIN (Config INNER JOIN (Border INNER JOIN (Spring INNER JOIN MSM ON
Spring.SpringID = MSM.SpringID) ON Border.BorderID = MSM.BorderID) ON Config.
ConfigID = MSM.ConfigID) ON Label.LabelID = MSM.LabelID) ON Needle.NeedleID =
MSM.NeedleID) ON Pattern.PatternID = MSM.PatternID) ON Size.SizeID = MSM.
SizeID) ON FoamCore.FoamCoreID = MSM.FoamCoreID) ON FoamEnc.FoamEncID = MSM.
FoamEncID) ON BoxProfile.BoxProfileID = MSM.BoxfileID) ON BoxType.BoxTypeID =
MSM.BoxtypeID;
 

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

Similar Threads


Top