Ulises,
Here's a method that has worked well for long SQL. I do a lot of SQL pass-through also, so I use this in both situations.
Build your SQL statement in pieces as strings and use macro expansion to actually execute it. I use a lot of [ and ] as delimiters, to save on problems with single and double quotes, also.
cMySelect = [SELECT blah blah ] + ;
[more blah blah ]
cMyFrom = [FROM this file ] + ;
[and some other files, joined ]
cMyWhere = [WHERE some criteria ] + ;
[and some other criteria ]
cMyGroupOrder = [GROUP BY something ] + ;
[and something else and ] + ;
[ORDER BY my order ]
cMySQLStatement = ;
cMySelect + ;
cMyFrom + ;
cMyWhere + ;
cMyGroupOrder
&cMySQLStatement
Even though you've carved off a few characters and gotten under the limit, you'll run into this again.
>I have a grid populated by a SQL Statement. I need 9 fields there.
>It works fine as long as I "Select (8 fields)..." as soon as I try to add the 9th field, I get a "Command contains unrecognized phrase/keyword" error message. I'm positive that my syntax is correct.
>What is the problem?
>Thank you for your time.
>
>Ulises.