Microsoft KB Archive/79797

{| = Q+E: Example of WHERE Clause with COMMAND Function =
 * width="100%"|

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(&quot;QE&quot;,&quot;system&quot;) A2: =EXECUTE(chan,&quot;[open('select * from sqlserver | dbo.authors where upper(au_lname)=RINGER')]&quot;) A3: =TERMINATE(chan) A4: =RETURN

A1: chan=INITIATE(&quot;QE&quot;,&quot;system&quot;) A2: =EXECUTE(chan,&quot;[command(1,'[open(select * from')]&quot;)  A3: =EXECUTE(chan,&quot;[command(2,'sqlserver | dbo.authors')]&quot;)   A4: =EXECUTE(chan,&quot;[command(3,'where       upper(au_lname)=&quot;&quot;RINGER&quot;&quot;)]')]&quot;) 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):

&quot;Q+E for Microsoft Excel User's Guide,&quot; version 3.0, pages 89-90, 101-102, 115-159
 * }