filter which queries are used in union query (1 Viewer)

DCrake

Remembered
Local time
Today, 10:31
Joined
Jun 8, 2005
Messages
8,632
You see, everthing is achievable if you know where to start. I did put some extra fields in your queries, mainly named PK. This was my first attempt. You can get rid of them as I did not use them in the end.

Also notice how I built in some validation to check whether the user had picked at least one section in the union script. You need to realise that the DOB (a) must always be there as this represents the first SELECT in the union query. If you miss this out you will get a syntax error in your union query sql.

Glad to be of help.:)
 

shenty

Registered User.
Local time
Today, 10:31
Joined
Jun 8, 2007
Messages
119
I tried leaving out the DOB (A) and doing a report to see what error came up so i could trap it but no error came up. !!!

Was this intended ?
 

DCrake

Remembered
Local time
Today, 10:31
Joined
Jun 8, 2005
Messages
8,632
Sorry, my mind was going backwards thinking about the earlier attempt. This was intended to create the union script and as the first query tbl = A uses the SELECT syntax my thoughts were if it was left out then the first part the sql would be UNION ALL SELECT. forget what I said, ok.

David
 

Users who are viewing this thread

Top Bottom