Forum Replies Created

Viewing 15 posts - 616 through 630 (of 2,452 total)

  • RE: Calculate Working days based on Holidaymaster table

    try looking at this part of your code

    select * from #temp and maybe count from there?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Help with Pivot

    please read this article and post back some scripts that we can all use easily.

    cheers

    edit...doh!

    https://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Help with the SELECT stmt logic please ?

    mw112009 (6/14/2016)


    My question is listed at the very end.

    Help me write neat code and lets see whether someone can come up with some code where we don't have to hard...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: find substring...and count...

    llouw1 (6/14/2016)


    I have read the article...and I really cannot see the link between my question and the article.

    did you go to the bottom of the articel and download the code?...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    I am still concerned about your insistence on having indeterminate column names (D1----D31).

    what is your reasoning to do this instead of having actual dates as column names in your...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    ganapathy.arvindan (6/12/2016)


    Done with the Nightshift

    DECLARE @sd DATEtime = '20161201'

    DECLARE @ed DATEtime = dateadd(mm, datediff(mm, 0, @sd) + 1, -1);

    WITH yourcalendar as (

    SELECT DATEADD(dd, rn - 1, @sd) thedate, 'D'...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    ganapathy.arvindan (6/12/2016)


    Any updates reg to Nightshift tables

    based on the code I gave you for "dayshift"...what have you tried that doesnt work for the other tables?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    ganapathy.arvindan (6/12/2016)


    Thank you so much..working fine for dayshift...let me know the changes for Nightshift

    feel free to PM me for my rates <grin>

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    as an initial thought for "dayshift" only ...........does the following give the desired results?.....obviously you will need to pivot the results !

    DECLARE @sd DATEtime = '20160101'

    DECLARE @ed DATEtime = dateadd(mm,...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    ganapathy.arvindan (6/12/2016)


    In previous i am working with shift calculations based on working days of the individual month..here i am trying to calculate every month working days..since the company declares holiday...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Calculate Working days based on Holidaymaster table

    this appears to be another post that is similar to others you have posted in recent weeks.......what have you tried so far, based on previous solutions you have been given?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Exclude weekend hours from datediff() function

    this may give you a few ideas

    http://www.sqlservercentral.com/Forums/Topic1440451-392-1.aspx

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: why planner is shorting in group by , can i elemenate sorting.

    rajemessage 14195 (6/6/2016)


    hi,

    CREATE TABLE [dbo].[T2](

    [A1] [bigint] NULL,

    [D1] [bigint] NULL

    ) ON [PRIMARY]

    SELECT d1,COUNT(a1) a FROM t2

    GROUP BY d1

    yours sincelrey

    not sure what your question...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Create or update rows on the basis of time interval

    Ok....my thoughts on this...would appreciate feedback from all, but especially the OP.

    Erland Sommarskog posted a possible solution here

    https://social.msdn.microsoft.com/Forums/en-US/aead4627-1baa-41e6-bbb2-7eeb031b526f/insert-into-the-table-based-on-intervals?forum=transactsql

    however, I dont think it worked for all date cases....so based on Erlands...

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • RE: Create or update rows on the basis of time interval

    I also see you have posted similar questions here

    https://social.msdn.microsoft.com/Forums/en-US/user/threads?user=InnovativeArihant

    but you have yet to reply......did any of the responses on that site help you?

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 15 posts - 616 through 630 (of 2,452 total)