Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

my how a query can grow like a weed . . .

Status
Not open for further replies.

riluve

Technical User
Mar 11, 2005
78
US
Sorry, I know this is going to sound fundamental, but I just can't seem to figure it out from the manual or from an online tutorial. I have a field (x) who's value should be a flag to indicate if the value of another field (y) occurs in a selection of a 3rd field (Z). Such that:

X indicates that Y occurs in the set Z.

keep in mind that these fields are nested in a much larger query and Y relate to Z through an INNER JOIN. The basic structure of the entire query is as follows:

Select Count(T1.A), Count(DISTINCT T1.B), ROUND(LOG(T1.C)), X = true if T1.Y occurs in T2.Z
FROM T1
INNER JOIN T2 ON T1.ID = T2.ID
WHERE T1.B BETWEEN D AND E
AND . . . .
AND . . .

So, I am not sure how to assemble this field or even if this is the best 'structure' for what I am trying to do. However, a push in the right direction would be much appriciated.

.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top