Q+E: Example of WHERE Clause with COMMAND Function

Last reviewed: November 4, 1994
Article ID: Q79797

SUMMARY

When using the WHERE clause with the COMMAND function in Q+E for Microsoft Excel, the string referenced by the WHERE clause must be enclosed in two sets of double quotation marks.

MORE INFORMATION

Consider the following examples:

   A1: chan=INITIATE("QE","system")
   A2: =EXECUTE(chan,"[open('select * from sqlserver |
       dbo.authors where upper(au_lname)=''RINGER''')]")
   A3: =TERMINATE(chan)
   A4: =RETURN()

   A1: chan=INITIATE("QE","system")
   A2: =EXECUTE(chan,"[command(1,'[open(''select * from')]")
   A3: =EXECUTE(chan,"[command(2,'sqlserver | dbo.authors')]")
   A4: =EXECUTE(chan,"[command(3,'where
       upper(au_lname)=""RINGER""'')]')]")
   A5: =TERMINATE(chan)
   A6: =RETURN()

In the first example, the string referenced by the WHERE clause is enclosed in two sets of single quotation marks, and the SELECT statement is enclosed in one set of single quotation marks.

The second example requires that the string referenced by the WHERE clause be enclosed in two sets of double quotation marks in order for the SELECT statement to be enclosed in two sets of single quotation marks.

Reference(s):

"Q+E for Microsoft Excel User's Guide," version 3.0, pages 89-90, 101-102, 115-159


KBCategory: kbother
KBSubcategory:

Additional reference words: 3.00 3.0 q+e q + e #ref open


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 4, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.