Results 1 to 5 of 5

Thread: Date function

  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: Date function

    Is it possible to retrive the number of days between two dates.

    I'm aware of the DateDiff function but I can't figure out how to calculate the number days between two columns containing dates in a table.

    All help is welcome

    Regrads OIS

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    select datediff (dd,col1,col2) from your table
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

  3. #3
    Join Date
    Apr 2004
    Posts
    22

    Question

    declare @fd1 datetime, @fd2 datetime

    set @fd1 = '20040513'
    set @fd2 = getdate()

    select datediff(d, @fd1, @fd2)

  4. #4
    Join Date
    Mar 2004
    Posts
    5

    Thanks alot

    It works perfect

    Thanks alot both of you

  5. #5
    Join Date
    Apr 2004
    Posts
    22
    Try to use BOL next time. Your example described in detail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •