Invalid parameter 1 specified for datediff.

omegalove
omegalove used Ask the Experts™
on
WHERE
            [pi].IndexID > @PageLowerBound AND
            [pi].IndexID < @PageUpperBound

And Country = @Country and
tbl_Profile.Gender = @Gender
and (DateDiff('yyyy', tbl_profile.BirthDate,getdate()) >= @Age1)
and (DateDiff('yyyy',tbl_profile.BirthDate,getdate()) <= @Age2)

      ORDER BY
            IndexID
      
      SET ROWCOUNT 0

      
      
END

Age1 and Age2 are integers
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Instead of 'yyyy' put YEAR without the ' '

Author

Commented:
awesome

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial