﻿<?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)  / strange result in stored procedure or PROBLEM / 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>Sat, 18 May 2013 18:39:34 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: strange result in stored procedure or PROBLEM</title><link>http://www.sqlservercentral.com/Forums/Topic436059-338-1.aspx</link><description>yes yes you right TNX</description><pubDate>Tue, 25 Dec 2007 14:57:26 GMT</pubDate><dc:creator>midan1</dc:creator></item><item><title>RE: strange result in stored procedure or PROBLEM</title><link>http://www.sqlservercentral.com/Forums/Topic436059-338-1.aspx</link><description>[quote][b]Jeff Moden (12/23/2007)[/b][hr]C'mon, Midan... this one is easy.  Figure it out.  If you're returning a column you don't want, then remove it from the SELECT list![/quote]how i must to give next day new date it is condition for evry dayso how to do itand the second problem is i need to see only the employee that existing in the "empid FROM v_un"now i see allTNX</description><pubDate>Mon, 24 Dec 2007 07:48:32 GMT</pubDate><dc:creator>midan1</dc:creator></item><item><title>RE: strange result in stored procedure or PROBLEM</title><link>http://www.sqlservercentral.com/Forums/Topic436059-338-1.aspx</link><description>In addition, corelated subqueries in the select caluse can result in poor performance as, depending on the plan chosen, SQL may have to execute each subquery once per row of the outer query.</description><pubDate>Sun, 23 Dec 2007 23:32:39 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: strange result in stored procedure or PROBLEM</title><link>http://www.sqlservercentral.com/Forums/Topic436059-338-1.aspx</link><description>C'mon, Midan... this one is easy.  Figure it out.  If you're returning a column you don't want, then remove it from the SELECT list!</description><pubDate>Sun, 23 Dec 2007 18:37:21 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>strange result in stored procedure or PROBLEM</title><link>http://www.sqlservercentral.com/Forums/Topic436059-338-1.aspx</link><description>this is my problem in stored procedure 1)  TABLE SilokE IS MY TABLE OF THE ALL EMPLOYEE2) I need to see only the employee than in the table v_un3) i see all the employee4) problem in this line  ( [new date] = @mydate2,[new_shift2] = )i see 2 rows of   result from fields [new date] + ,[new_shift] how to see only  1 field for  each field      new date  new_shift    new date   empid  name   ---------------------------------------------------------------2007-12-01     99   2007-12-02    99   2568947     aaa2007-12-01     99   2007-12-02    99   2845209     bbbb2007-12-01     99   2007-12-02    99   4807756     ccc2007-12-01     99   2007-12-02    99   9819590     ddd2007-12-01     99   2007-12-02    99   10055648    eee 2007-12-01     99   2007-12-02    99   10815413     ffff2007-12-01     99   2007-12-02    99   11070042    gggg2007-12-01     99   2007-12-02    99   11162047    hhh-------------------------------------------------------------------------------i need to see only one  for  each fieldnew date    new_shift       id         name   ---------------------------------------------------------------2007-12-01  99      2568947     aaa2007-12-01  99    2845209     bbbb2007-12-01  99    4807756     ccc2007-12-01  99    9819590     ddd2007-12-02  99    10055648    eee 2007-12-02  99  10815413     ffff2007-12-02  99   11070042    gggg2007-12-02  99    11162047    hhhCode Block[code] DECLARE @yeara [varchar](4) DECLARE @month1 [varchar](2) DECLARE @day1 [varchar](2) DECLARE @day2 [varchar](2) DECLARE @day3 [varchar](2) DECLARE @mydate1 [datetime] DECLARE @mydate2 [datetime] set @yeara ='2007' SET @month1 ='12' Set @day1 ='1'Set @day2 ='2' set @mydate1 = CONVERT([datetime] ,@day1 + '/'+ @month1 + '/' + @yearA ,103) set @mydate2 = CONVERT([datetime] ,@day2 + '/'+ @month1 + '/' + @yearA ,103) select[new date1]=@mydate1,[new_shift] = CASE WHEN (empid IN (SELECT empid FROM v_un WHERE (shift = 51 ))) THEN1 WHEN(empid IN (SELECT empid FROM v_un WHERE (shift = 11 ))) THEN 2 else99 END, [new date2]=@mydate2,[new_shift2]= CASE WHEN (empid IN (SELECT empid FROM v_un WHERE (shift = 11 ))) THEN 1 WHEN(empid IN (SELECT empid FROM v_un WHERE (shift = 12 ))) THEN2 else88 END, SilokE.empid, SilokE.Fname FROM SilokE [/code]tnx for all the help i get here</description><pubDate>Sun, 23 Dec 2007 16:58:52 GMT</pubDate><dc:creator>midan1</dc:creator></item></channel></rss>