How unit 2 strings?

Edwik

Registered User.
Local time
Today, 15:25
Joined
Aug 19, 2005
Messages
40
Hi all.

I have 2 strings:

strSQL1 = SELECT FieldA FROM table WHERE FieldA = xxx
strSQL2 = SELECT FieldB FROM table WHERE FieldB = xxx

I need unit this two strings to third string strSQL3.
I must have result StrSQL3 = SELECT FieldA, FieldB FROM table WHERE FieldA = xxx and FieldB = xxx

Is it possibly unit strings (not Select Query)?
 
strSQL1 = SELECT FieldA FROM table WHERE FieldA = xxx
strSQL2 = SELECT FieldB FROM table WHERE FieldB = xxx


strSql3 = strSQL1 & strSQL2
 
When I write:
strSql3 = strSQL1 & strSQL2

I recieve same resultat as strSql3 = strSQL1
 
Syntax is

SELECT xxx FROM yyyy UNION
SELECT www from ZZZ ;
 
On re-reading, I see another interpretation of what you asked. My first answer assumes one way of looking at your question. Here is the other possibility.

"I must have result StrSQL3 = SELECT FieldA, FieldB FROM table WHERE FieldA = xxx and FieldB = xxx"

Consider something that includes the following:

SELECT FieldA & FieldB FROM Table WHERE ...

But if you are talking about NOT doing this in a query, maybe what you need is to do a DLookup and use the ampersand to concatenate two DLookup functions. This is what you would do in VBA code.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom