Sizing queries

S

Selby

I am using 2007 and the queries that I run contain several blank columns. I
have tried to delete these columns in design view but they still appear when
the query is run. How can I get my query to just show the info I need and
not these extra blank columns?

Thanks!
 
S

Selby

I should have clarified - the extra blank columns appear at the end of the
query.

SELECT Tags.TagCode, Tags.TagID, Tags.TagDate, qryItems.ItemNumber,
qryItems.ItemDescription, UnitTypes.UnitType, TagCanCodes.CanCode,
Sum(-([QtyShipped])) AS TotQtyShipped, TagShippingInfo.ShipDate,
TagShippingInfo.[Invoice#/NewPalletTag#]
FROM UnitTypes INNER JOIN ((qryItems INNER JOIN Tags ON qryItems.ItemNumber
= Tags.ItemNumber) INNER JOIN (TagCanCodes INNER JOIN TagShippingInfo ON
TagCanCodes.TagCanCodeID = TagShippingInfo.TagCanCodeID) ON Tags.TagNum =
TagCanCodes.TagNum) ON UnitTypes.UnitID = Tags.UnitType
GROUP BY Tags.TagCode, Tags.TagID, Tags.TagDate, qryItems.ItemNumber,
qryItems.ItemDescription, UnitTypes.UnitType, TagCanCodes.CanCode,
TagShippingInfo.ShipDate, TagShippingInfo.[Invoice#/NewPalletTag#],
Tags.TagNum, Tags.ItemNumber
HAVING (((Tags.ItemNumber)=[Enter ItemNumber]))
ORDER BY TagCanCodes.CanCode;
 
J

Jerry Whittle

Hi,

I count 10 columns that should be returned. Are there more than this? If so,
what does their column headings say?

I noticed that you are grouping on two columns ( Tags.TagNum and
Tags.ItemNumber) that aren't in the Select. Still this shouldn't cause blank
columns to show up. Are you sure that they aren't filled with null values?

I hate seeing field names with special characters, including blanks, as it
could cause problems. Without the square brackets, [Invoice#/NewPalletTag#]
could be interpeted as trying to divide two other fields or a time field or
both. In the future avoid special anything that isn't a 123 or abc. The
Underscore _ is OK.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Selby said:
I should have clarified - the extra blank columns appear at the end of the
query.

SELECT Tags.TagCode, Tags.TagID, Tags.TagDate, qryItems.ItemNumber,
qryItems.ItemDescription, UnitTypes.UnitType, TagCanCodes.CanCode,
Sum(-([QtyShipped])) AS TotQtyShipped, TagShippingInfo.ShipDate,
TagShippingInfo.[Invoice#/NewPalletTag#]
FROM UnitTypes INNER JOIN ((qryItems INNER JOIN Tags ON qryItems.ItemNumber
= Tags.ItemNumber) INNER JOIN (TagCanCodes INNER JOIN TagShippingInfo ON
TagCanCodes.TagCanCodeID = TagShippingInfo.TagCanCodeID) ON Tags.TagNum =
TagCanCodes.TagNum) ON UnitTypes.UnitID = Tags.UnitType
GROUP BY Tags.TagCode, Tags.TagID, Tags.TagDate, qryItems.ItemNumber,
qryItems.ItemDescription, UnitTypes.UnitType, TagCanCodes.CanCode,
TagShippingInfo.ShipDate, TagShippingInfo.[Invoice#/NewPalletTag#],
Tags.TagNum, Tags.ItemNumber
HAVING (((Tags.ItemNumber)=[Enter ItemNumber]))
ORDER BY TagCanCodes.CanCode;


Jerry Whittle said:
Please show us the SQL statement for the query in question.
 
Top