Expression exceeds 1,024 character limit...

G

Guest

"The expression you entered exceeds the 1,024-character limit for the query
design grid."

I just saved a make-table query with a new field name and evidently that new
field name is now too long or invalid, and I no longer can open the query or
view its design. If I try to open in design view, I get the above error. If I
try to run the query, I get the error that the field name is invalid or too
long. So it appears the query is now out of my reach and I can't open it up
either way.

Anyway, I'm assuming I'll have to recreate the query, which won't take too
much time, but is there a way to crack into the query back-door and salvage
some of the structure from it, or am I trying to go down a dead-end road?

Thanks.
 
J

John Vinson

"The expression you entered exceeds the 1,024-character limit for the query
design grid."

I just saved a make-table query with a new field name and evidently that new
field name is now too long or invalid, and I no longer can open the query or
view its design. If I try to open in design view, I get the above error. If I
try to run the query, I get the error that the field name is invalid or too
long. So it appears the query is now out of my reach and I can't open it up
either way.

Anyway, I'm assuming I'll have to recreate the query, which won't take too
much time, but is there a way to crack into the query back-door and salvage
some of the structure from it, or am I trying to go down a dead-end road?

Thanks.

Try opening it in SQL view. One way this can happen is unbalanced
quotemarks.

John W. Vinson[MVP]
 
J

John Spencer

One method is to open the VBA window and in the immediate window enter the
following.

?currentdb().QueryDefs("Your query name in quotes").SQL

When you hit return, the SQL statement will appear in the immediate window.
 
G

Guest

Once you get at the query, there are a couple of ways to reduce the number of
characters. One is to use an alias for the table name like so:

-- The original query
SELECT tblDatesPaymentsAnalysis.InvoiceNumber,
tblDatesPaymentsAnalysis.invoice_date,
tblDatesPaymentsAnalysis.Value,
tblDatesPaymentsAnalysis.paid_date
FROM tblDatesPaymentsAnalysis
WHERE (((tblDatesPaymentsAnalysis.invoice_date)>#1/1/2006#))
ORDER BY tblDatesPaymentsAnalysis.InvoiceNumber;

-- With an A alias that cuts the number of characters almost in half:
SELECT A.InvoiceNumber,
A.invoice_date,
A.Value,
A.paid_date
FROM tblDatesPaymentsAnalysis A
WHERE (((A.invoice_date)>#1/1/2006#))
ORDER BY A.InvoiceNumber;

Another way is just to do a SELECT * instead of calling out each field.
Sloppy and might not be of much use for a make table query.
 
G

Guest

Good suggestions, all. Thank you.

Jerry Whittle said:
Once you get at the query, there are a couple of ways to reduce the number of
characters. One is to use an alias for the table name like so:

-- The original query
SELECT tblDatesPaymentsAnalysis.InvoiceNumber,
tblDatesPaymentsAnalysis.invoice_date,
tblDatesPaymentsAnalysis.Value,
tblDatesPaymentsAnalysis.paid_date
FROM tblDatesPaymentsAnalysis
WHERE (((tblDatesPaymentsAnalysis.invoice_date)>#1/1/2006#))
ORDER BY tblDatesPaymentsAnalysis.InvoiceNumber;

-- With an A alias that cuts the number of characters almost in half:
SELECT A.InvoiceNumber,
A.invoice_date,
A.Value,
A.paid_date
FROM tblDatesPaymentsAnalysis A
WHERE (((A.invoice_date)>#1/1/2006#))
ORDER BY A.InvoiceNumber;

Another way is just to do a SELECT * instead of calling out each field.
Sloppy and might not be of much use for a make table query.
 

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