|
Hi I have 2 paramater as startdate and enddate After subtracting this ie @date = ( startdate- enddate) Now i want to conert it into @date=@date/60/60/24/365. It say me datetime cannot be converted into int. Kindly help me wiyth script
(comments are locked)
|
|
It appears that you are looking for a difference in seconds between 2 dates. If this is so then you don't really need to divide the difference by /60/60/24/365. The difference between 2 datetime values is still a datetime, you cannot divide it by an integer. To get what you need, use datediff function instead: You can read the answer to this question, it has a pretty detailed explanation about datetime math. Oleg
(comments are locked)
|

