General information
Category:
Coding, syntax & commands
I have the following SQL statement as the rowsource of a dropdown box that works fine:
SELECT '***All Sales Reps*** ' AS Name, '*****'AS
salesrepid FROM salesreps UNION SELECT ALLTRIM(lastname)+', '+ALLTRIM
(firstname) AS Name,salesrepid FROM salesreps INTO CURSOR curSalesRep ORDER BY name
I would like to add a WHERE statement to the second Select statement as follows:
SELECT '***All Sales Reps*** ' AS Name, '*****'AS salesrepid FROM salesreps UNION SELECT ALLTRIM(lastname)+', '+ALLTRIM(firstname) AS Name,salesrepid FROM salesreps INTO CURSOR curSalesRep WHERE salesreps.active = 1 ORDER BY name
However, when I do this I get a syntax error. What am I doing wrong? What is the correct syntax for this statement?
Thanks in advance,
Russell
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only