Query: ATTN Ken Snell

  • Thread starter Thread starter tcv
  • Start date Start date
T

tcv

Ken,

You and I spoke some weeks ago about a query I was trying to create.
You wanted me to post the SQL statment. The original thread is here:

http://tinyurl.com/2phee

Here is the SQL statement you asked for:

SELECT NICKLABL1.[FIRST NAME], NICKLABL1.INITIAL, NICKLABL1.[LAST
NAME], NICKLABL1.ADDLINE1, NICKLABL1.ADDLINE2, NICKLABL1.CITY,
NICKLABL1.STATE, NICKLABL1.[ZIP OR POST], NICKLABL1.COUNTRY,
NICKLABL1.[COMPANY NAME]

FROM NICKLABL1

ORDER BY NICKLABL1.[ZIP OR POST], WHERE([INACTIVE]=True And
(<>"" And [EMAIL] Is Not Null)) Is Not Null;
 
You've got an extra Is Not Null, WHERE has to precede ORDER BY and the comma
before the word WHERE is incorrect.

ORDER BY NICKLABL1.[ZIP OR POST], WHERE([INACTIVE]=True And
(<>"" And [EMAIL] Is Not Null)) Is Not Null;

Try

SELECT NICKLABL1.[FIRST NAME], NICKLABL1.INITIAL, NICKLABL1.[LAST
NAME], NICKLABL1.ADDLINE1, NICKLABL1.ADDLINE2, NICKLABL1.CITY,
NICKLABL1.STATE, NICKLABL1.[ZIP OR POST], NICKLABL1.COUNTRY,
NICKLABL1.[COMPANY NAME]
FROM NICKLABL1
WHERE([INACTIVE]=True And ([EMAIL]<>"" And [EMAIL] Is Not Null))
ORDER BY NICKLABL1.[ZIP OR POST]

Note that ([EMAIL]<>"" And [EMAIL] Is Not Null)) could be replaced by
Len(EMAIL & "") > 0 (or Len(Trim$(EMAIL & "")) > 0 if you want to ignore
anything where the contents of EMAIL is simply blanks)
 
Back
Top