Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Time calculation

Time calculation

Scheduled Pinned Locked Moved Database
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AVPRF
    wrote on last edited by
    #1

    Hi, In my table having, from time and to time, I have to calculate the difference between the two times to calculate hour's of time worked. So can anyone provide me a solution

    M 1 Reply Last reply
    0
    • A AVPRF

      Hi, In my table having, from time and to time, I have to calculate the difference between the two times to calculate hour's of time worked. So can anyone provide me a solution

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Do some research into DATEDIFF[^]

      Never underestimate the power of human stupidity RAH

      A 1 Reply Last reply
      0
      • M Mycroft Holmes

        Do some research into DATEDIFF[^]

        Never underestimate the power of human stupidity RAH

        A Offline
        A Offline
        AVPRF
        wrote on last edited by
        #3

        Yes, I checked using datediff and my query is

        select datediff(hh,'05:30:00','10:00:00') from tablename

        but it gives me 5 as answer which is not correct

        M 1 Reply Last reply
        0
        • A AVPRF

          Yes, I checked using datediff and my query is

          select datediff(hh,'05:30:00','10:00:00') from tablename

          but it gives me 5 as answer which is not correct

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          It is perfectly correct, you looked for the difference in hours. Use your brain, try minutes or even seconds, if you wait for answers to be spoon fed to you it is going to be a long slow day.

          Never underestimate the power of human stupidity RAH

          A 1 Reply Last reply
          0
          • M Mycroft Holmes

            It is perfectly correct, you looked for the difference in hours. Use your brain, try minutes or even seconds, if you wait for answers to be spoon fed to you it is going to be a long slow day.

            Never underestimate the power of human stupidity RAH

            A Offline
            A Offline
            AVPRF
            wrote on last edited by
            #5

            Thanks.. I got the answer

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups