1

Topic: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

http://www.sql.ru/forum/1272678/istochnik-dannyh
The code a little altered (Produces an error: the Erratic either passed reserved keyword or argument in instruction SELECT or an incorrect punctuation):
Private Sub Kombinirovannaja3_AfterUpdate ()
Dim b As String
b = "SELECT Chiefs. A surname," and _
"Employees. A surname," and _
"FROM Chiefs" and _
"INNER JOIN Employees" and _
"ON Chiefs. Department = Employees. Department = '" both Me.3.Value and "'"
Me. RecordSource = b
End Sub
In what there can be an error?

2

Re: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

Debug. Print b

3

Re: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

But generally such as

WHERE field1 = field2 = literal

it is not admissible syntactically. Do two conditions and AND between them.

4

Re: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

Akina wrote:

But generally such as

WHERE field1 = field2 = literal

it is not admissible syntactically. Do two conditions and AND between them.

basically, syntactically, it is admissible.
If field1 - logical, and as if condition performance (field2 = literal) is checked.

5

Re: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

I not to that it is truly applied.
Simply, basically.

6

Re: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

Akina even if I remove field2, produces the same error

7

Re: To pull out some columns sql-inquiry on VBA under intersected conditions of sampling

Bad_oder , well and where the turned out text of request? Or it very confidential?