datediff of ssrs

I have date in number data type, I am using expression as attached.

It shows #Error in the report, I have attached a screen shot of the report which shows #Error in 'Days' column marked with Red Box.

Please guide me if i am wrong.
datediff.jpg
datedifferr.jpg
Syed Shareef AhmedSenior System AnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bcnagelCommented:
One quick thing to try would be to substitute DateInterval.Day for your "DAY" value (the value of the first parameter). The DateInterval class is a Visual Basic enumeration class with members that can be seen here:

https://msdn.microsoft.com/en-us/library/microsoft.visualbasic.dateinterval%28v=vs.110%29.aspx 

I've had good success using the members of that class whenever SSRS is looking for an interval in a date function.

Remember not to use quotes around DateInterval.Day.
0
Syed Shareef AhmedSenior System AnalystAuthor Commented:
Hi,

Thanks for suggestion, when I change the expression I receive any error, please find attached of screen shots.
datediff-exp-1.jpg
datedifferr-1.jpg
0
bcnagelCommented:
No problem, Syed.

I'm assuming you've tested your RIGHT(), LEFT(), and MID() logic--you've verified that they are returning the data that you want. That being the case, the DATEDIFF() function expects date values, so I would *NOT* use the FORMAT() function at all.  I would try simply passing the result of your CDATE() functions to DATEDIFF().

Does that make sense?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB2

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.