E
Ed MacAlmon
I'm working with MSDE in an Access .adp project and trying to create a
view that will specify an age range run against GETDATE() so that I can
return various groups of children within a specific age range, say 3 - 5
year-olds. I have this code in my Select statement (0 +
CONVERT(char(8),GETDATE(), 112) - CONVERT(char(8), dbo.T_PERSON.DOB,
112)) / 10000 AS Age which seems to report the child's date of birth in
years and am trying to use the following in the Where section to limit
the return to the age range I'm looking for. (dbo.T_PERSON.DOB BETWEEN
GETDATE - (0 + CONVERT(char(8), GETDATE(), 112)- CONVERT(char(8),
dbo.T_PERSON.DOB, 112)) / 10000 - 3) AND GETDATE - (0 + CONVERT(char(8),
GETDATE(), 112) - CONVERT(char(8),dbo.T_PERSON.DOB, 112)) / 10000 - 5)
It doesn't work. Can someone tell me if this is off the wall, just needs
a tweak, or there is a better way to do this. Thanks for any help. --Ed
view that will specify an age range run against GETDATE() so that I can
return various groups of children within a specific age range, say 3 - 5
year-olds. I have this code in my Select statement (0 +
CONVERT(char(8),GETDATE(), 112) - CONVERT(char(8), dbo.T_PERSON.DOB,
112)) / 10000 AS Age which seems to report the child's date of birth in
years and am trying to use the following in the Where section to limit
the return to the age range I'm looking for. (dbo.T_PERSON.DOB BETWEEN
GETDATE - (0 + CONVERT(char(8), GETDATE(), 112)- CONVERT(char(8),
dbo.T_PERSON.DOB, 112)) / 10000 - 3) AND GETDATE - (0 + CONVERT(char(8),
GETDATE(), 112) - CONVERT(char(8),dbo.T_PERSON.DOB, 112)) / 10000 - 5)
It doesn't work. Can someone tell me if this is off the wall, just needs
a tweak, or there is a better way to do this. Thanks for any help. --Ed