Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 DateDiff Problem

Author  Topic 

daniel50096230
Yak Posting Veteran

99 Posts

Posted - 2011-05-09 : 02:30:31
Dear All,

I have the query

Select Case When DATEDIFF(month, BL.Opening_Date, DATEADD(M,0,@AsAtDate))> = 6 then 6 else DATEDIFF(month, BL.Opening_Date, @AsAtDate) End As MonthDifference

From Table1

This query run perfectly in SQL Server. But there is no number show out in my vb.net report for those record Date Difference less than 6. However, for those record Date Difference more than 6, it can be shown in my report. ANyone can advice?

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-05-09 : 02:47:10
What is the datatype and value of @AsAtDate?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

daniel50096230
Yak Posting Veteran

99 Posts

Posted - 2011-05-09 : 03:05:26
the datatype of @AsAtDate is varchar. For those record DateDiff is less than 6, it able to shown in SQL Server but not able to show in vb.net report. I am wondering whether the output datatype of DateDiff is not compatible with VB.net
Go to Top of Page
   

- Advertisement -