FoxProProgrammer
Programmer
Is there a way to combine the following three queries into a single query? It works the way it is; I was just curious if there's a better way.
Query 1: SELECT fldlist FROM tblname WHERE somefld = "X"
Query 2: SELECT fldlist FROM tblname WHERE somefld = "Y"
Query 3: SELECT otherflds FROM tblname
Query 4: SELECT [Query 1].*, [Query 2].*, [Query 3].* FROM [Query 1], [Query 2], [Query 3];
All four queries return one record. The fields contain a bunch of aggregate functions from a large table. The reason that I broke it up into three queries is because I didn't know how to specify more than one Where clause in the same query. Note that fldlist contains the same fields for Query 1 and Query 2. The only difference is that I want to retrieve certain records based on the contents of another field (i.e. somefld equal X or Y). Is there a better way to do this?
Thanks a lot,
dz
dzaccess@yahoo.com
Query 1: SELECT fldlist FROM tblname WHERE somefld = "X"
Query 2: SELECT fldlist FROM tblname WHERE somefld = "Y"
Query 3: SELECT otherflds FROM tblname
Query 4: SELECT [Query 1].*, [Query 2].*, [Query 3].* FROM [Query 1], [Query 2], [Query 3];
All four queries return one record. The fields contain a bunch of aggregate functions from a large table. The reason that I broke it up into three queries is because I didn't know how to specify more than one Where clause in the same query. Note that fldlist contains the same fields for Query 1 and Query 2. The only difference is that I want to retrieve certain records based on the contents of another field (i.e. somefld equal X or Y). Is there a better way to do this?
Thanks a lot,
dz
dzaccess@yahoo.com