Hi,
I have been stuck at this for sometime. I will appreciate if someone helps me. I have a date of birth column and one age column. In the final result I would like to see members turning 18 this year starting from today so today would be (1st of month...August 1st 2010). In crystal, the formula is: Year({table1.bdate}) <= Year(CurrentDate) - 18
Question is: how do I write this in sql.
I have something like this: (DATEDIFF(year, bdate, DATEADD(s, - 1, DATEADD(mm,DATEDIFF(m, 0, GETDATE()), 0))) = 18)
But this give me results of members turning 18 for the whole year including MArch, April etc.
I have been stuck at this for sometime. I will appreciate if someone helps me. I have a date of birth column and one age column. In the final result I would like to see members turning 18 this year starting from today so today would be (1st of month...August 1st 2010). In crystal, the formula is: Year({table1.bdate}) <= Year(CurrentDate) - 18
Question is: how do I write this in sql.
I have something like this: (DATEDIFF(year, bdate, DATEADD(s, - 1, DATEADD(mm,DATEDIFF(m, 0, GETDATE()), 0))) = 18)
But this give me results of members turning 18 for the whole year including MArch, April etc.