Forum Replies Created

Viewing 15 posts - 301 through 315 (of 1,114 total)

  • RE: How to find Week start date and Week end date

    Lynn Pettis (3/4/2009)


    karthikeyan (3/4/2009)


    Chris Morris (3/3/2009)


    karthikeyan (3/3/2009)


    His method is working fine. I have tested it.

    Actually my requiremrnt is little bit different what he has given.

    Can you demonstrate please, Karthik?...

  • RE: How to find Week start date and Week end date

    Lynn Pettis (3/3/2009)


    Yep, your right, I had a slight mistake in my code. Here is the corrected code:

    declare @pDate datetime;

    set @pDate = getdate();

    select

    dateadd(wk, datediff(wk, 0,...

  • RE: How to find Week start date and Week end date

    Michael Valentine Jones (3/3/2009)


    karthikeyan (3/3/2009)


    The below query will give the current week's first date and lastdate.

    Declare @InputDate Datetime

    select @InputDate = '28/feb/2009'

    select case when upper(datename(dw,@InputDate)) = 'MONDAY' then @InputDate

    ...

  • RE: How to find Week start date and Week end date

    Chris Morris (3/3/2009)


    karthikeyan (3/3/2009)


    Hi All,

    Thanks for all your inputs!:)

    I found the TSQL 101 solution.

    Declare @InputDate Datetime

    select @InputDate = '02/mar/2009'

    select case when upper(datename(dw,@InputDate)) = 'MONDAY' then dateadd(dd,-7,@InputDate)

    ...

  • RE: How to find Week start date and Week end date

    Lynn Pettis (3/3/2009)


    Here is another way to accomplish this, based again an Sergiy's original code:

    declare @pDate datetime;

    set @pDate = getdate();

    select

    dateadd(wk, datediff(wk, 0, @pDate - 1), 0)...

  • RE: How to find Week start date and Week end date

    Chris Morris (3/3/2009)


    karthikeyan (3/3/2009)


    His method is working fine. I have tested it.

    Actually my requiremrnt is little bit different what he has given.

    Can you demonstrate please, Karthik? I'd be very...

  • RE: How to find Week start date and Week end date

    His method is working fine. I have tested it.

    Actually my requiremrnt is little bit different what he has given.

  • RE: How to find Week start date and Week end date

    I am sure there should be some other way to do the same. Please post here if anybody has alternate query.

  • RE: How to find Week start date and Week end date

    The below query will give the current week's first date and lastdate.

    Declare @InputDate Datetime

    select @InputDate = '28/feb/2009'

    select case when upper(datename(dw,@InputDate)) = 'MONDAY' then @InputDate

    ...

  • RE: How to find Week start date and Week end date

    Hi All,

    Thanks for all your inputs!:)

    I found the solution.

    Declare @InputDate Datetime

    select @InputDate = '02/mar/2009'

    select case when upper(datename(dw,@InputDate)) = 'MONDAY' then dateadd(dd,-7,@InputDate)

    ...

  • RE: How to find Week start date and Week end date

    Lynn,

    if i give the start date of a week, then it should take the last week's start date and end date.

    saturday & sunday should be eliminated.

    i.e 23/feb/2009 to 27/feb/2009

    why?

    simply i...

  • RE: Index selection + C or NC ?

    I have tested the remaining queries with both index. Both of them took the same time to complete the execution. only difference is 'FORWARD SCAN' and 'BACKWARD SCAN' method in...

  • RE: SSC Members Name

    Thanks Steve!

    I will be very happy if my name remain as it is. Politely saying, Since i visited our site more no of times(1370 visits from the joining date) and...

  • RE: Index selection + C or NC ?

    Ok. I will try and get back to you shrotly.

    Generally speaking, which scan type(FORWARD or BACKWARD) will work fast? How any why? How it is working internally?

  • RE: Index selection + C or NC ?

    I have created a non clustered index to exception table.

    But i used two different column order.

    1)create nonclustered index sk_exception on exception(feed_num,err_cd,symbol)

    I created the above index first.

    then i executed the procedure.

    exec...

Viewing 15 posts - 301 through 315 (of 1,114 total)