I'm trying to calculate, from a SQL statement, the count of days to a persons birthday.
I'm trying the following:
strSQL = "SELECT * FROM Employees WHERE (DateDiff('d', Date, (DateSerial(Mon th([DateOfBirth]),Day([DateOfBirth]),Year(Date))) BETWEEN 0 AND 5"
The [DateOfBirth] is a field in the Employees table. Yet, I always receive a 3061 runtime error... anybody got any idea what is wrong? Yes, there are records in the table satisfying the asked conditions.
Many many thanks in advance!
I'm trying the following:
strSQL = "SELECT * FROM Employees WHERE (DateDiff('d', Date, (DateSerial(Mon th([DateOfBirth]),Day([DateOfBirth]),Year(Date))) BETWEEN 0 AND 5"
The [DateOfBirth] is a field in the Employees table. Yet, I always receive a 3061 runtime error... anybody got any idea what is wrong? Yes, there are records in the table satisfying the asked conditions.
Many many thanks in advance!
Comment