all groups > sql server reporting services > july 2005 >
You're in the

sql server reporting services

group:

DateDiff Function, VERY IMPORTANT!!!!!



DateDiff Function, VERY IMPORTANT!!!!! DragonVic
7/1/2005 1:18:01 PM
sql server reporting services: I have 2 dates one a parameter and one from a field, I need to calculate the
number of days inside a reporting services expression window. The Datediff
function does not seem to work, I cannot do it on the SQL Query because one
Re: DateDiff Function, VERY IMPORTANT!!!!! Bruce L-C [MVP]
7/1/2005 3:31:28 PM
You can use the datediff in your query.

SELECT DATEDIFF(day, pubdate, @date) AS no_of_days
FROM titles where pubdate > @date


--
Bruce Loehle-Conger
MVP SQL Server Reporting Services


[quoted text, click to view]

Re: DateDiff Function, VERY IMPORTANT!!!!! Wayne Snyder
7/3/2005 7:56:02 AM
You can also do it in the expression using VB datediff ie

=datediff(DateInterval.Day,Parameters!myparm.Value,Today())

I prefer doing this stuff in sql like Mike does tho...

--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)

I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org

[quoted text, click to view]

AddThis Social Bookmark Button