specific select from query

newegyptian

Registered User.
Local time
Today, 13:00
Joined
May 8, 2019
Messages
4
نننن.jpg





HOW I CAN MAKE THIS BUTTON TO WORK AS I WANT TO SELECT DADNAME WHO HAS HIS LAST CHILD NAMED AS IN SEARCH TEXT BOX "MALEK"
 

Attachments

probably like this...

(sir, may i suggest that you read a little bit on data normalization. it's a very big concept that is preached by the experts around here. the reason being, is because you can end up confusing yourself quite a bit in the future if things aren't set up probably when you begin). but in terms of what you currently want, this will work fine.
 

Attachments

Hmm, aside from Plog's suggestion. How, based on your table, is your query suppose to determine that? The logic makes no sense. as you could have a table filled with Dad's and Malek's. So what is the real world plan for this database?
 
You might have a hard time with that question unless you alter it just a little bit. Bear with me here...

Determining the "last child" is very difficult - but determining the YOUNGEST child (which is also the last child) isn't. It is in how you ask the question.

Looking at the supplied DB, your problem is that your data entry persons can never make a mistake in child order because the question you asked cannot be reliably answered if they do. But if you had included birthdate in your dataset, you would have had a reliable way to order the children of each parent according to birthdate. Then you would have an easy way to guarantee the youngest child for each parent. After that, finding one that matches a particular string would not be that difficult.

You need to include data to support decisions over and above the actual data you would be displaying.
 

Users who are viewing this thread

Back
Top Bottom