Set int count from datediff(day)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sl1ver
    New Member
    • Mar 2009
    • 196

    Set int count from datediff(day)

    i got an int @count
    i want to set it to the number of day differences in sql, i tried

    Code:
    @count = datediff(day,min(date),max(date))
    even tried to cast datediff to int but it doesn't work, any suggestions?
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32636

    #2
    The first parameter should be a short string. What you have is not valid. I expect 'd' would do it for you, but see DATEDIFF (Transact-SQL) for the full story.

    Comment

    Working...