Need Advice please

Thread Solved
Reply

Join Date: Apr 2008
Posts: 14
Reputation: NickMalone85 is an unknown quantity at this point 
Solved Threads: 0
NickMalone85 NickMalone85 is offline Offline
Newbie Poster

Need Advice please

 
0
  #1
Nov 24th, 2008
I am using MS SQL server, and I'm trying to create a SQL query that adds data to a "Reminder" table if data in the "Occurrences" table meets certain criteria. This might be a little difficult to explain. Here's the problem... I have a table "Occurrences" which i updated every week with the absences of all the employee's in the plant. It records the date and time, Name of the employee, and the reason of absence. I need to create a SQL query that will add employees to a "Reminder" table any time they have 3 or more absences in a 90 day time frame.

I've been able to make a query that will put employees in the "Reminder" table if an employee gets 3 absences in the last 90 days, but the problem with that is that I only want to update this table once a week. If it only compares the last 90 days then it could possible miss an employee that deserves to be in the "Reminder" table.

I've been working on this for a long time. Can anyone tell me a better way to attack this problem?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,158
Reputation: dickersonka will become famous soon enough dickersonka will become famous soon enough 
Solved Threads: 136
dickersonka dickersonka is offline Offline
Veteran Poster

Re: Need Advice please

 
0
  #2
Nov 24th, 2008
why do you need the extra table?

why don't you just query from occurences, the same one that you populated reminder with?
Custom Application & Software Development
www.houseshark.net
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 14
Reputation: NickMalone85 is an unknown quantity at this point 
Solved Threads: 0
NickMalone85 NickMalone85 is offline Offline
Newbie Poster

Re: Need Advice please

 
0
  #3
Nov 24th, 2008
I have an idea. I'll post it if it works.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MS SQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC