472,123 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,123 software developers and data experts.

Set int count from datediff(day)

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

Expand|Select|Wrap|Line Numbers
  1. @count = datediff(day,min(date),max(date))
  2.  
even tried to cast datediff to int but it doesn't work, any suggestions?
Oct 22 '10 #1
1 2644
NeoPa
32,497 Expert Mod 16PB
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.
Oct 22 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Lauren Quantrell | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.