sql and truncating field on export

  • Thread starter Thread starter JohnE
  • Start date Start date
J

JohnE

Hello. I have a button on a form that exports the information from
Access2007 to Excel2007. The exporting process works fine with the exception
of truncating a field that is longer then 255. The truncating comes from the
Group By in the sql below. If I take out the Group By, there is no
truncating issue. But a group of users need to have Group By in. But a
group needs to see all the info in the field. I added the FIRST to the field
that truncates and removed it from the Group By line. But the field still
truncates. Here is the sql that is not working.

sql = "SELECT ItemNumber, PartNumber, PartNumberMajorRevision, Description,
Quantity, First(ReferenceDesignator) AS FirstOfReferenceDesignator,
ManufacturerName, ManufacturerPartNumber"
sql = sql & " FROM PartsPerAssemblyWithManufacturersInfoQ"
sql = sql & " WHERE [AssemblyNumber] = '" & PartNumber & "' "
sql = sql & " AND [AssemblyRevision] = '" & cboViewRevision & "'"
sql = sql & " AND ItemNumber <> 0"
sql = sql & " Group BY ItemNumber, PartNumber, PartNumberMajorRevision,
Description, Quantity, ManufacturerName, ManufacturerPartNumber"
sql = sql & " ORDER BY " & order_by

Can please some of the people some of the time but can't please all the
people all of the time. Can anyone see what is wrong or have an alternative
method?

Thanks... John
 
Access will always truncate a memo field when it is used in a query
containing a Group By, Distinct, or DistinctRow clause in the query.

It is unclear why you are using the Group By clause in your query.
Generally this is only used when you want to aggregate some data using
Count(), Sum(), Min(), Max(), ..

Why does the "group of users need to have Group By in"?

Tell us what you want to do, not how you want to do it and I'm sure one of
us can resolve your issue for you.
 
Back
Top