Forum Replies Created

Viewing 15 posts - 646 through 660 (of 2,452 total)

  • RE: Calculate time difference based on Status field

    shagil.a.gopinath (5/31/2016)


    Dear Team,

    My requirement is to calculate the failure time, I just want to know the difference in hours where the status is 'I' and it shouldnt calculate if status...

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/30/2016)


    IT IS WORKING FINE BUT IN THE OUTPUT I ALSO NEED THE DETAILS OF D1..D31 SHIFTS AND FINALLY THE WORKING DAYS

    LIKE THIS

    empid D1 ...

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/30/2016)


    Yes your right, it is a pivot table, please let me know whether it is possible to calculate working days in pivot table itself, please help me in solving...

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/30/2016)


    Yes your right, it is a pivot table, please let me know whether it is possible to calculate working days in pivot table itself, please help me in solving...

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

  • RE: Compare 3 tables and calculate working days

    I am wondering ....based on some of your previous threads.....are these "tables" not real tables but pivoted views of your raw data?

    In my opinion, to get the results that you...

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/29/2016)


    trying to add a image on employee table format but not able to

    please read this

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

    "images" dont help us replicate your data

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/29/2016)


    Employee tableformat

    ok....care to explain what you mean by "Employee tableformat"

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

  • RE: Compare 3 tables and calculate working days

    I am sorry, but I cannot help you.

    for what its worth here is some code to set up the data in SSMS....based on on your previous posts

    USE [tempdb]

    GO

    IF OBJECT_ID('tempdb..dayshift') IS...

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

  • RE: Join a row from one table to just one row from another table by time.

    itsyourssankalpa (5/29/2016)


    This is what I did.

    I am sure there is more efficient way to do this though.

    if object_id ('tempdb..#Temp') is not null

    drop table #temp

    if object_id ('tempdb..#Temp1') is not null

    drop table...

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

  • RE: Compare 3 tables and calculate working days

    ganapathy.arvindan (5/29/2016)


    Another table Table_shift

    consider an employee is in the following shift types

    D1 to D7 in Dayshift D9 to D13 NightShiftIH D16 to D20 Day...

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

  • RE: Join a row from one table to just one row from another table by time.

    itsyourssankalpa (5/29/2016)


    That works. I used cross apply and then created two new temp table that didn't have time in the resulting table from cross apply, and joined those two for...

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

  • RE: overlap query where to and from can be same ( of next and previous range)

    possible guess on what you expect...........is this right or wrong?

    +---------------------+

    ¦ pointfrom ¦ pointto ¦

    ¦-----------+---------¦

    ¦ 1 ¦ 6 ...

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

  • RE: overlap query where to and from can be same ( of next and previous range)

    rajemessage 14195 (5/28/2016)


    pls answer

    well this thread is now over three months old......and looking back thro it, you have been given various suggestions.....do any of them work for you?,

    If not...

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

  • RE: Pergormance tuning for idiots (me)

    http://www.sqlservercentral.com/articles/books/94937/

    this is the second edition

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

  • RE: Date Change

    domleg (5/27/2016)


    I don't know how to do that, I'm very new at SQL, I only basic select statements etc... that's why I'm here to get the exact method...

    try reading thro...

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

Viewing 15 posts - 646 through 660 (of 2,452 total)