Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 20764

Calculating age by means of a parameter

$
0
0

Hi,

I can't find the question on the forum, hopefully anyone can help me out.

For a report I need to calculate the employee's age by reference date. As I want to be able to generate reports with a reference date in the past and the future I use a parameter to decide the reference date.

Example;

D.o.B. = 5 March 1988

Reference date = 1 February 2013

If I use Datediff(DateInterval.Year, D.o.b., reference date) I get age 25 instead of 24.

Anyone a solution? 

Many thanks in advance!

SQL Server 2008 R2, Report Builder 3.0



Viewing all articles
Browse latest Browse all 20764


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>