B
Bluesky
Hi All,
Hoping you can help.
I'm using the following to get current age in a query:
NewCurrAge: (DateDiff("m",[DOB],Date())+(Day([DOB])>Day(Date())))\12 & " yrs
" & (DateDiff("m",[DOB],Date())+(Day([DOB])>Day(Date()))) Mod 12 & " mos"
My BIG problem is that I also want to pull certain ages, especially 9 to 13
for one query and 14 to 17 in another query.
So, in the same query for criteria I used:
Between 9 yrs 0 mos And 13 yrs 12 mos
Error: the expression contains invalid syntax. you entered an operator
without an operand.
Then I tried:
Between 9 "yrs" 0 "mos" And 13 "yrs" 12 "mos" - which again doesn't work.
Error: the expression contains invalid syntax. you entered an operator
without an operand.
Then I tried: Between "yrs"=9 And "mos"=0 And "yrs"=13 And "mos"=12
Error: data type mismatch
Then I tried: Between "9 yrs 0 mos" And "13 yrs 12 mos"
The query returns values starting at 13 yrs 2 mos to 18 yrs 3 mos (which is
problably the oldest age).
I'm obviously not writing the query correctly, but can't figure it out.
Thanks again,
Debbie
Hoping you can help.
I'm using the following to get current age in a query:
NewCurrAge: (DateDiff("m",[DOB],Date())+(Day([DOB])>Day(Date())))\12 & " yrs
" & (DateDiff("m",[DOB],Date())+(Day([DOB])>Day(Date()))) Mod 12 & " mos"
My BIG problem is that I also want to pull certain ages, especially 9 to 13
for one query and 14 to 17 in another query.
So, in the same query for criteria I used:
Between 9 yrs 0 mos And 13 yrs 12 mos
Error: the expression contains invalid syntax. you entered an operator
without an operand.
Then I tried:
Between 9 "yrs" 0 "mos" And 13 "yrs" 12 "mos" - which again doesn't work.
Error: the expression contains invalid syntax. you entered an operator
without an operand.
Then I tried: Between "yrs"=9 And "mos"=0 And "yrs"=13 And "mos"=12
Error: data type mismatch
Then I tried: Between "9 yrs 0 mos" And "13 yrs 12 mos"
The query returns values starting at 13 yrs 2 mos to 18 yrs 3 mos (which is
problably the oldest age).
I'm obviously not writing the query correctly, but can't figure it out.
Thanks again,
Debbie