Finding discrepancies in data with a query
Posted: Mon Oct 24, 2011 10:26 am
Hello,
I'm not sure if I can explain this as clearly as I would like, but my database is basically a rota system, let's say for example, that I have a table named tbl_shifts and a table named tbl_weeks for each of the 7 day fields in tbl_weeks (week_day1, week_day2, ... ) every shift must be covered from day 2 to day 6.
I have now got all my data in the DB and now just want to validate it for errors in the data entry (it was all manual) so I would like to construct some SQL queries that find weeks in the weeks table that aren't valid. I would also like to run a query to identify shifts that have a seconds value in the start or finish time. The time fields are formatted as H:i:m.
I built the first query I need, but it returns thousands of results (which definitely isn't the case).
Could anybody help?
I'm not sure if I can explain this as clearly as I would like, but my database is basically a rota system, let's say for example, that I have a table named tbl_shifts and a table named tbl_weeks for each of the 7 day fields in tbl_weeks (week_day1, week_day2, ... ) every shift must be covered from day 2 to day 6.
I have now got all my data in the DB and now just want to validate it for errors in the data entry (it was all manual) so I would like to construct some SQL queries that find weeks in the weeks table that aren't valid. I would also like to run a query to identify shifts that have a seconds value in the start or finish time. The time fields are formatted as H:i:m.
I built the first query I need, but it returns thousands of results (which definitely isn't the case).
Could anybody help?