<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Program With Dave</title>
	<atom:link href="http://www.daveandrews.org/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daveandrews.org</link>
	<description>My Programming Tutorials and Experiments</description>
	<lastBuildDate>Mon, 19 Jul 2010 05:02:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by Dave Andrews</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-258</link>
		<dc:creator>Dave Andrews</dc:creator>
		<pubDate>Mon, 19 Jul 2010 05:02:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-258</guid>
		<description>jk--

You break it into weeks by creating a calendar table and pre-populating it with the data. You then join to that table to determine which week the time entry occured in.</description>
		<content:encoded><![CDATA[<p>jk&#8211;</p>
<p>You break it into weeks by creating a calendar table and pre-populating it with the data. You then join to that table to determine which week the time entry occured in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by jk</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-257</link>
		<dc:creator>jk</dc:creator>
		<pubDate>Wed, 07 Jul 2010 01:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-257</guid>
		<description>Hi Dave,

Thank you for your response. No I havent broken it into weeks.  I am not sure how to do it.  Is is possible for you to write it?  In my code I am getting last 4 weeks data from whatever todays date is.

Thank you for your help in advanced.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Thank you for your response. No I havent broken it into weeks.  I am not sure how to do it.  Is is possible for you to write it?  In my code I am getting last 4 weeks data from whatever todays date is.</p>
<p>Thank you for your help in advanced.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by Dave Andrews</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-256</link>
		<dc:creator>Dave Andrews</dc:creator>
		<pubDate>Mon, 28 Jun 2010 12:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-256</guid>
		<description>Do you already have it broken out into weeks? You can&#039;t do so unless you can get something like:

week 1, employee 1, num ot hours
week 2, employee 1, num ot hours
week 3, employee 1, num ot hours
week 4, employee 1, num ot hours

Are you able to get it into a format like that? The code I had above didn&#039;t include any week partitioning.</description>
		<content:encoded><![CDATA[<p>Do you already have it broken out into weeks? You can&#8217;t do so unless you can get something like:</p>
<p>week 1, employee 1, num ot hours<br />
week 2, employee 1, num ot hours<br />
week 3, employee 1, num ot hours<br />
week 4, employee 1, num ot hours</p>
<p>Are you able to get it into a format like that? The code I had above didn&#8217;t include any week partitioning.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by jk</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-255</link>
		<dc:creator>jk</dc:creator>
		<pubDate>Sat, 26 Jun 2010 02:39:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-255</guid>
		<description>Hi Dave,

Can I get an answer for the request below?
Your code works great. I am trying to figure out how to add to your code so that I can get last 4 weeks OT Avg. I have two parameters , workeddate and departmentcode. So when I choose a date from workeddate and departmencode, it should give me last 4 weeks Avg. from the workeddate.

Thank you for your help.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Can I get an answer for the request below?<br />
Your code works great. I am trying to figure out how to add to your code so that I can get last 4 weeks OT Avg. I have two parameters , workeddate and departmentcode. So when I choose a date from workeddate and departmencode, it should give me last 4 weeks Avg. from the workeddate.</p>
<p>Thank you for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by jk</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-251</link>
		<dc:creator>jk</dc:creator>
		<pubDate>Fri, 11 Jun 2010 01:13:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-251</guid>
		<description>Dave,

Your code works great. I am trying to figure out how to add to your code so that I can get  last 4 weeks OT Avg.    I have two parameters ,  workeddate and departmentcode. So when I choose a date from workeddate and departmencode, it should give me last 4 weeks Avg. from the workeddate.

Thank you for your help.</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Your code works great. I am trying to figure out how to add to your code so that I can get  last 4 weeks OT Avg.    I have two parameters ,  workeddate and departmentcode. So when I choose a date from workeddate and departmencode, it should give me last 4 weeks Avg. from the workeddate.</p>
<p>Thank you for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by Dave Andrews</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-239</link>
		<dc:creator>Dave Andrews</dc:creator>
		<pubDate>Thu, 27 May 2010 01:04:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-239</guid>
		<description>The system I wrote does exactly that. The company does semi-monthly payments (15 and last day) so I had to have a &quot;status&quot; flag on each time entry. The statuses are:

1. Unapproved
2. Approved
3. Approved By Payroll
4. Payroll Processed

All time entries go in with status of 1. When the employee&#039;s supervisor approves their timesheet, it becomes 2. When the payroll user agrees, the status is 3. When it&#039;s processed by the file, it&#039;s 4.

So what I had to do was sum up all the time entries that occurred before the 1st (or the 16th) that had a status of 4. If that total was more than 40, then the employee was already in overtime. If the sum of the week plus the previous &quot;status 4&quot; entries was more then 40, then the employee went into overtime later in the week.

You also have to break up weeks by the start date and end date. Since we are going by 40 hours a week, we can&#039;t use the date range of 1-15 and 16-31 for this. The 1st of the month may actually be a Wednesday, so you have to go back to the Sunday of that week to begin totaling. I have a table of weeks from 1990 up until 2030 that I utilize for this.

The report I wrote here (of which this post is A VERY SIMPLIFIED SUBSET) was for a company of about 300 employees and it&#039;s working fantastic for them. In that case, I had the luxury that I had written the entire time entry and payroll system, so I could change it to suit my needs. I wish I could post some code but I can&#039;t because as a consultant I don&#039;t own it. I would really recommend that you NOT use a single SQL query to do this, but rather iterate through entries in code. I had to do so in this case due to some business requirements.</description>
		<content:encoded><![CDATA[<p>The system I wrote does exactly that. The company does semi-monthly payments (15 and last day) so I had to have a &#8220;status&#8221; flag on each time entry. The statuses are:</p>
<p>1. Unapproved<br />
2. Approved<br />
3. Approved By Payroll<br />
4. Payroll Processed</p>
<p>All time entries go in with status of 1. When the employee&#8217;s supervisor approves their timesheet, it becomes 2. When the payroll user agrees, the status is 3. When it&#8217;s processed by the file, it&#8217;s 4.</p>
<p>So what I had to do was sum up all the time entries that occurred before the 1st (or the 16th) that had a status of 4. If that total was more than 40, then the employee was already in overtime. If the sum of the week plus the previous &#8220;status 4&#8243; entries was more then 40, then the employee went into overtime later in the week.</p>
<p>You also have to break up weeks by the start date and end date. Since we are going by 40 hours a week, we can&#8217;t use the date range of 1-15 and 16-31 for this. The 1st of the month may actually be a Wednesday, so you have to go back to the Sunday of that week to begin totaling. I have a table of weeks from 1990 up until 2030 that I utilize for this.</p>
<p>The report I wrote here (of which this post is A VERY SIMPLIFIED SUBSET) was for a company of about 300 employees and it&#8217;s working fantastic for them. In that case, I had the luxury that I had written the entire time entry and payroll system, so I could change it to suit my needs. I wish I could post some code but I can&#8217;t because as a consultant I don&#8217;t own it. I would really recommend that you NOT use a single SQL query to do this, but rather iterate through entries in code. I had to do so in this case due to some business requirements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by Noor</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-235</link>
		<dc:creator>Noor</dc:creator>
		<pubDate>Tue, 25 May 2010 14:27:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-235</guid>
		<description>I have custom time entry system, the only problem I am facing right now is our payroll runs bimonthly which is 15 and last day of month, and overtime calculation is on weekly basis means 40 hours a week.

Please advice how to take contol of this I need report with EmployeeId, RegularHours, OTHours on 15th and last day of month.

Thanks</description>
		<content:encoded><![CDATA[<p>I have custom time entry system, the only problem I am facing right now is our payroll runs bimonthly which is 15 and last day of month, and overtime calculation is on weekly basis means 40 hours a week.</p>
<p>Please advice how to take contol of this I need report with EmployeeId, RegularHours, OTHours on 15th and last day of month.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by J</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-232</link>
		<dc:creator>J</dc:creator>
		<pubDate>Sat, 22 May 2010 18:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-232</guid>
		<description>Hey Dave, I have a small project of creating an excel sheet that would collect data offline for a web app I have with a MySQL backend. Please contact me offline and let me know if you would be interested or if you know of someone who would.
Thanks
J.</description>
		<content:encoded><![CDATA[<p>Hey Dave, I have a small project of creating an excel sheet that would collect data offline for a web app I have with a MySQL backend. Please contact me offline and let me know if you would be interested or if you know of someone who would.<br />
Thanks<br />
J.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Beginning Code for iPad Game by Jokerit</title>
		<link>http://www.daveandrews.org/2010/05/17/beginning-code-for-ipad-game/comment-page-1/#comment-218</link>
		<dc:creator>Jokerit</dc:creator>
		<pubDate>Tue, 18 May 2010 13:09:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=365#comment-218</guid>
		<description>Nice work ;)</description>
		<content:encoded><![CDATA[<p>Nice work <img src='http://www.daveandrews.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using SQL To Accrue Values (Overtime in Time Entries) by Joseph</title>
		<link>http://www.daveandrews.org/2010/03/15/using-sql-to-accrue-values-overtime-in-time-entries/comment-page-1/#comment-196</link>
		<dc:creator>Joseph</dc:creator>
		<pubDate>Tue, 11 May 2010 00:58:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.daveandrews.org/?p=313#comment-196</guid>
		<description>I tried bout I am getting different numbers. where Do I put the query ? and  

Do I divide Hoursuptothispoint to itself to get OT pertencetage or  Hoursuptothispoint +  Totalhoursinday / Hoursuptothispoint ?  as I am trying to refernce to Regularhours  + OTHours / OTHours in your code?    Thank you for time and help.</description>
		<content:encoded><![CDATA[<p>I tried bout I am getting different numbers. where Do I put the query ? and  </p>
<p>Do I divide Hoursuptothispoint to itself to get OT pertencetage or  Hoursuptothispoint +  Totalhoursinday / Hoursuptothispoint ?  as I am trying to refernce to Regularhours  + OTHours / OTHours in your code?    Thank you for time and help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
