﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / help insert employee to #temp table all month / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 04:15:46 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: help insert employee to #temp table all month</title><link>http://www.sqlservercentral.com/Forums/Topic439283-338-1.aspx</link><description>Ok I'm going to make a wild guess and say they are looking for a CASE statement to determine the weekday.empid date val day name-----------------------------------1111 1/2/2008 1 Tuesday1111 2/2/2008 1 Wednesday1111 3/2/2008 1 Thursday1111 4/2/2008 1 Friday1111 5/2/2008 99 Saturday1111 6/2/2008 55 SundaySo[code]CASE WHEN [day name] = 'Saturday' THEN 99 WHEN [day name] = Sunday THEN 55 ELSE 1 END[/code]At least I think that is part of it.Although if I were you I would re-post using Jeff's Best Pratcties for posting doc.  It would make things alot easier to understand.</description><pubDate>Sun, 06 Jan 2008 09:21:35 GMT</pubDate><dc:creator>Kenneth.Fisher</dc:creator></item><item><title>RE: help insert employee to #temp table all month</title><link>http://www.sqlservercentral.com/Forums/Topic439283-338-1.aspx</link><description>My "Whahuh?" was directed at the OP, not your link. :)I can't tell what they want to accomplish no matter how many times I read it.</description><pubDate>Sun, 06 Jan 2008 03:26:58 GMT</pubDate><dc:creator>David McFarland</dc:creator></item><item><title>RE: help insert employee to #temp table all month</title><link>http://www.sqlservercentral.com/Forums/Topic439283-338-1.aspx</link><description>It's a "hint" on how to post data... :P</description><pubDate>Sun, 06 Jan 2008 00:01:22 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: help insert employee to #temp table all month</title><link>http://www.sqlservercentral.com/Forums/Topic439283-338-1.aspx</link><description>Whahuh?</description><pubDate>Sat, 05 Jan 2008 23:12:59 GMT</pubDate><dc:creator>David McFarland</dc:creator></item><item><title>RE: help insert employee to #temp table all month</title><link>http://www.sqlservercentral.com/Forums/Topic439283-338-1.aspx</link><description>[url]http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]</description><pubDate>Sat, 05 Jan 2008 20:27:28 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>help insert employee to #temp table all month</title><link>http://www.sqlservercentral.com/Forums/Topic439283-338-1.aspx</link><description>help insert employees to #temp table all monthand loop insert until the last employeei have table employeeempid name--------------------1111 xxxx2222 yyyy-----------------------now i need to insert all the employee for all month to one tablelike thisinsert empid=1111to tb_tempstart day=01/02/2008end day = 11/02/2008val=1NEXTinsert empid=2222to tb_tempstart day=05/02/2008end day = 20/02/2008val=5NEXT....and after i need to get the employee in the temp_tableBUT WITH conditionand only on Saturday + Sundayi need to change the val !if 'Saturday'than val=55if 'Sunday'than val=99  if 'monday'Normal processingif 'tuesday'Normal processingif 'wednesday'Normal processingif 'thursday'Normal processingif 'Friday'Normal processing.........................required output resultempid date val day name-----------------------------------1111 1/2/2008 1 Tuesday1111 2/2/2008 1 Wednesday1111 3/2/2008 1 Thursday1111 4/2/2008 1 Friday1111 5/2/2008 99 Saturday1111 6/2/2008 55 Sunday1111 7/2/2008 11111 8/2/2008 11111 9/2/2008 1 1111 10/2/2008 11111 11/2/2008 12222 6/2/2008 55 Sunday2222 7/2/2008 5 Monday2222 8/2/2008 5 Tuesday2222 9/2/2008 5 Wednesday2222 10/2/2008 5 Thursday2222 11/2/2008 5 Friday2222 12/2/2008 99 Saturday2222 13/2/2008 52222 14/2/2008 52222 15/2/2008 52222 16/2/2008 5----------------TNX</description><pubDate>Sat, 05 Jan 2008 18:24:44 GMT</pubDate><dc:creator>midan1</dc:creator></item></channel></rss>