This documentation is archived and is not being maintained.

SqlMethods.DateDiffHour Method

Counts the number of hour boundaries between two specified dates.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Static member DateDiffHour(DateTime, DateTime) Counts the number of hour boundaries between two non-nullable dates.
Public method Static member DateDiffHour(Nullable<DateTime>, Nullable<DateTime>) Counts the number of hour boundaries between two nullable dates.
Public method Static member DateDiffHour(DateTimeOffset, DateTimeOffset) Counts the number of hour boundaries between two non-nullable dates.
Public method Static member DateDiffHour(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) Counts the number of hour boundaries between two nullable dates.
Top

Corresponds to the SQL Server DATEDIFF function; using hour to specify the type of time boundary crossed. For more about this SQL Server function, see DATEDIFF in the Microsoft SQL Server Books Online.

Show: