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 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 a 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!
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 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 a 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!