Thanks John, vanderghast and Daryl,
I guess I was hoping to be simplify my programming and code maintenance.
Rather than concatenate a bunch of string variables, some with module
scope
and some only local as I originally planned, and then keeping track of
which
concatenation was which, I thought "Wouldn't it be nice if ..."
Back in September John W Vinson helped me solve a different problem and
when I asked why/how it worked, he replied in part
'- since (in SQL processing) the FROM clause is parsed before the SELECT
clause'
which was so blindingly obvious in hindsight, and it got me to briefly
thinking about
how I would write a parser. So, when faced with the prospect of naming a
whole bunch
of variables closely similar but different enough to remember the
distinctions later,
my thoughts returned to "Does the parser really care?"; syntax rules are
one thing but
practice might be different. That's why I thought I'd ask those who know
how the parser
really operates before I tried something which might bite me later.
Wait. I just realized. Since this SQL string is intended to be a
parameter passed to a
function I have written to populate an ocx control, I could define the
static bits in the
function itself. That way I only have to pass the WHERE clause and
concatenate it
within the function. Now I'll only have a bunch of strWhere variables to
track.
Thanks again guys for your advice.
--
Len
______________________________________________________
remove nothing for valid email address.
| Len -
|
| Yes the order is important, and ORDER BY comes after WHERE. You can
search
| the internet for SQL Syntax.
| --
| Daryl S
|
|
| ".Len B" wrote:
|
| > Are there any rules that govern clause order? Does the
| > parser care?
| >
| > Obviously SELECT must be first but does WHERE have to
| > precede ORDER BY?
| >
| > This question arises because I have a situation where
| > the VBA code would be easier if the WHERE could be the
| > final clause. That way I could have an unchanging
| > SELECT, FROM, ORDER BY string and just tag the WHERE; on
| > the tail. My thinking then turned to whether there is
| > a mandated order for other clauses too.
| >
| > Is there an article somewhere to explain it?
| >
| > --
| > Len
| > ______________________________________________________
| > remove nothing for valid email address.
| >
| >
| > .
| >