Stooney Posted September 23, 2009 Share Posted September 23, 2009 So I feel I may have a design flaw here. I've created a site where users submit reports to admins. Reports are required to be submitted by a certain date. Users are assigned clients. Each client is assigned report types. These are the reports the user must upload for the client. Each report type is due X days from the start of the fiscal year it is assigned.. I need to somehow be able to find out which reports are missing. I don't think I can query a database for what doesn't exist. A report is missing if the due_date (number of days the report type is due from start of the fiscal year) is less than the number of days that have passed since the start of the fiscal year it is assigned to. How do I efficiently determine what reports are missing from the database based on that? I really hope I explained that well, and I'm sure I'm not going about this correctly. All help is appreciated. So I have this general design (slimmed way down for simplicity): files table report_id report_type (used with the due dates table) client_id (the client the report was uploaded for) user_id (the user who submitted the report) year_id (fiscal year) due dates table report_type due_date (number of days after start of fiscal year the report is due) client/therapist table (list of which client is assigned to which users) client_id user_id client required file types table (the report types required for the clients) client_id report_type report types table (just the report type info) report_type (id) report_name years table year_id start_date Quote Link to comment https://forums.phpfreaks.com/topic/175184-calculate-what-is-missing/ Share on other sites More sharing options...
w3evolutions Posted September 29, 2009 Share Posted September 29, 2009 Are all report_type required for each client_id? Quote Link to comment https://forums.phpfreaks.com/topic/175184-calculate-what-is-missing/#findComment-926983 Share on other sites More sharing options...
Stooney Posted October 5, 2009 Author Share Posted October 5, 2009 In the current situation, yes. Quote Link to comment https://forums.phpfreaks.com/topic/175184-calculate-what-is-missing/#findComment-930454 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.