HELP calculate the difference between 2 date feild

  • how can i calculate in Hours the difference between 2 date feild

    fld1=14/07/2003 07:00:00

    fld2=15/07/2003 17:00:00

    i wont to see how many Hours

    ---------------------------

    thnks

    ilan

  • BOL:

    quote:


    DATEDIFF

    Returns the number of date and time boundaries crossed between two specified dates.

    Syntax:

    DATEDIFF ( datepart , startdate , enddate )

    Arguments

    datepart:

    Is the parameter that specifies on which part of the date to calculate the difference. The table lists dateparts and abbreviations recognized by Microsoft® SQL Server™.

    Datepart Abbreviations :

    Year yy, yyyy

    quarter qq, q

    Month mm, m

    dayofyear dy, y

    Day dd, d

    Week wk, ww

    Hour hh

    minute mi, n

    second ss, s

    millisecond ms


    Regards, Hans

    Edited by - HansLindgren on 07/13/2003 11:38:45 AM

  • BTW Do try to keep your DATE questions to one topic...

  • thnks a lot

    ilan

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply