NEED HELP - results to row???

S

Stephen

Hi Folks,

i'm getting a little in-over-my-head with this small project that is turning
into a real bear...

I have a query that runs based on certain parameters that is working
properly however I am in need of returning results of multiple columns from
a single record in my db to one of two particular columns on my sheet. my
query checks for non zero values in the db for columns a - j in my db but
needs to return the results to either column f or g on my sheet.

I'm thinking I need to create an alias but can I use an alias for ten
different coulmns from my db?

SELECT DISTINCT Order.OrdrDesc, Wearer.FrstName, Wearer.LastName,
Garment.GarmDesc, Wearer.Labl, Wearer.Aloc01, Wearer.ChrgQnty01,
Wearer.Aloc02, Wearer.ChrgQnty02, Wearer.Aloc03, Wearer.ChrgQnty03
FROM Garment LMGarment, Order Order, Wearer Wearer
WHERE Wearer.RcID = Garment.WearRcID AND Order.RcID = Wearer.OrdrRcID AND
((Wearer.OrdrRcID=?) AND (Order.RcID=?) AND (Wearer.Aloc01<>0) AND
(Wearer.ChrgQnty01<>0) AND (Wearer.Aloc02<>0) AND (Wearer.Aloc03<>0))

see where this is going? I need the correct aloc and chrg quanties to
appear on the correct row. In one particular instance my db has a wearer
that has three garments allocated to them; a gown, a top, and a pant. the
aloc quantites are 3, 11, and 11 respectively. right my query returns all
the correct information for this wearer except all three rows have 3 as the
aloc value (two of the row should return 11, and I'd like that to appear in
the same column on my sheet.

Thank you all in advance!
 

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