Hi everyone
I'm real new to SQL and phprunner. I need some help with a query I'm trying to wright.
I have a table (Eating). The fields are 'ID' 'NameID' 'Date1' 'Breakfast' 'Lunch' 'Dinner'
ID is an autonumber
Name is text
Date1 is a date
Breafast, lunch and dinner are check boxes.
I have a complex set of relationships set up.
- The 'Eating' table is subordinate to the 'Client Name'table. The related field is 'NameID'.
- I have created 3 alternate views to the 'Eating' Table. They are called 'AM' 'PM' and 'Night'. I have done this so the enduser sees them as child records on the 'Client Name' list. When the enduser clicks on the 'AM' child record in the 'Client Name' list they are given 2 fields to complete: 'Date1' and 'Breakfast'. Similarly when 'PM' child record is selected from the 'Client Name' list the enduser completes: 'Date1' and 'Lunch'. Then the same occurs for 'Night'.
The end user ticks the check box to say they have eaten breakfast, lunch and/or dinner. They may have eaten all three or none at all.
I need a query that will generate a report to tell me who has NOT had anything to eat for 3 or more days.
I would like to keep my current database architecture however if this is the reason a query can not be generate I'm happy to consider something different to get the end result.
Thanks in advance for your assistance.