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. get difference between two double precision columns

get difference between two double precision columns

Scheduled Pinned Locked Moved Database
question
4 Posts 3 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.
  • K Offline
    K Offline
    kani98
    wrote on last edited by
    #1

    I am trying to compute the difference between two double precision columns, start_time and stop_time. I used this select statement: Select (stop_time - start_time) AS Duration From table; The result I get back is a column name Duration with empty cells. What should be the correct syntax? Thanks.

    B W 2 Replies Last reply
    0
    • K kani98

      I am trying to compute the difference between two double precision columns, start_time and stop_time. I used this select statement: Select (stop_time - start_time) AS Duration From table; The result I get back is a column name Duration with empty cells. What should be the correct syntax? Thanks.

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      What are datatypes of columns stop_time and start_time ?


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

      K 1 Reply Last reply
      0
      • B Blue_Boy

        What are datatypes of columns stop_time and start_time ?


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        K Offline
        K Offline
        kani98
        wrote on last edited by
        #3

        the columns are of type double.

        1 Reply Last reply
        0
        • K kani98

          I am trying to compute the difference between two double precision columns, start_time and stop_time. I used this select statement: Select (stop_time - start_time) AS Duration From table; The result I get back is a column name Duration with empty cells. What should be the correct syntax? Thanks.

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Could it be that either stop_time or start_time is NULL. In that case the result would be NULL.

          The need to optimize rises from a bad design. My articles[^]

          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