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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying records in a grid if value = x 1

Status
Not open for further replies.

keepfoxing

Programmer
Dec 9, 2015
37
PH
what i want is to display only the records being filtered with the value on the field of single and male.
how to do this using set filter?

thanks in advance
 
it worked..
can i add another condition to that
like this one?
SELECT distinct Name FROM TheTable WHERE name NOT in (SELECT name FROM TheTable WHERE AgeOfChild <= 12 and AgeOfChild = value)
 
i used the code you gave
SELECT distinct Name FROM TheTable WHERE name NOT in (SELECT name FROM TheTable WHERE AgeOfChild <= 12 and AgeOfChild = value)
and added the code:
INTO TABLE "c:\System\Data\sampletable.dbf"

how to make the id_no available for searching or making it index..
 
> WHERE AgeOfChild <= 12 and AgeOfChild = value
You're again making the bad move of having two possibly contradicting conditions on the same field.
One number can be <=12 and at the same time can be 11, but then it's the same condition as simply querying AgeOfChild = 11. And if value>12 you have no record, thus all records are not in that empty set.

You're losing the condition you wanted. You need a workshop on logic, as it seems.

You're most probably not even aware that this condition is about what no child of a parent should be, this subquery is processed with [tt]NOT in[/tt], which means you get records of the main select that are NOT in that sub query.

You have to understand, that this condition is programmed as negation of your condition ALL children should be older than 12, negated to the condition, that NO child is younger. If you add conditions here, you add conditions to the children a person should NOT have.

I strongly assume your real query again is more complex and you don't combine conditions corectly. And most probably this time brackets are not helping.

> how to make the id_no available for searching or making it index..
There are several ids for each name, so that's not available.

Please, as you are really not that good in putting conditions into code, tell us in english, what people and names you want, and we might give you this "fish" (instead of teaching you fishing).

Bye, Olaf.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top