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. sql server2000

sql server2000

Scheduled Pinned Locked Moved Database
databasetutorialquestion
6 Posts 4 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
    ahmedalisha
    wrote on last edited by
    #1

    hi How to get difference between time i.e column1 have some start time and column2 have some finish time difference between column1 and column2?

    A N S 3 Replies Last reply
    0
    • A ahmedalisha

      hi How to get difference between time i.e column1 have some start time and column2 have some finish time difference between column1 and column2?

      A Offline
      A Offline
      andyharman
      wrote on last edited by
      #2

      Look in the online-help for the datediff function.

      1 Reply Last reply
      0
      • A ahmedalisha

        hi How to get difference between time i.e column1 have some start time and column2 have some finish time difference between column1 and column2?

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        Are you looking for this[^] ? Happy Programming

        Navaneeth My Website

        1 Reply Last reply
        0
        • A ahmedalisha

          hi How to get difference between time i.e column1 have some start time and column2 have some finish time difference between column1 and column2?

          S Offline
          S Offline
          Sgg245
          wrote on last edited by
          #4

          DATEDIFF() function accepts two DATETIME values and a date portion (minute, hour, day, month, and so on) as parameters. DATEDIFF() determines the difference between the two date values passed, expressed in the date portion specified

          Regards SG (sgg245@yahoo.co.in)

          A 1 Reply Last reply
          0
          • S Sgg245

            DATEDIFF() function accepts two DATETIME values and a date portion (minute, hour, day, month, and so on) as parameters. DATEDIFF() determines the difference between the two date values passed, expressed in the date portion specified

            Regards SG (sgg245@yahoo.co.in)

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

            hi then what should be the data type of that column, so that i can save time only. bec in my requirement i have requested any department for a request. so at what time they received my request and what time they have replayed me i.e i want to calculate how much time taken to complete my request thanks alisha

            S 1 Reply Last reply
            0
            • A ahmedalisha

              hi then what should be the data type of that column, so that i can save time only. bec in my requirement i have requested any department for a request. so at what time they received my request and what time they have replayed me i.e i want to calculate how much time taken to complete my request thanks alisha

              S Offline
              S Offline
              Sgg245
              wrote on last edited by
              #6

              The datatype of the column should be DATETIME... Use the following type query:: select convert(varchar(10), c6, 108) from t1 In this query, Column 'c6' is of DATETIME type and this query will give you only time part of the column and over this you can use DATEDIFF() function...

              Regards SG (sgg245@yahoo.co.in)

              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