Another undefined function problem

F

frankerin

Hello

I am using access 2003. A query field I have been using for several years
contains the following code in order to keep a current age in reports. I has
always worked.

AGE:
Year(Now())-Year([birth])+(DateSerial(Year(Now()),Month([birth]),Day([birth]))>Now())

I have tested the function in the same query as a separate field expr1 etc.
Day([birth]) works, year([birth])works. Why not month([birth]) suddenly?

Now "month([birth]) is undefined and it is so in several other queries which
use this function. [birth] is a complete birthday, eg 12/25/200?

No references appear to be missing at least according to Allen Brown's list.

I really need to solve this as these reports are always in demand.

How would you proceed? I would be very grateful
 
F

frankerin

I just realized and I don't know why (the file format says access 2000.
Whether this was always true, at this time I really don't know. It should be
access 2003.
 
J

John W. Vinson

I just realized and I don't know why (the file format says access 2000.
Whether this was always true, at this time I really don't know. It should be
access 2003.

Not particularly. By default both Access2002 and Access2003 create databases
in 2000 format. There are few significant differences between the 2000 and
2002/3 formats, and the program can use either one; it defaults to 2000 (I
presume) so that you can develop databases which can be used by people who
only have the older version.
frankerin said:
Hello

I am using access 2003. A query field I have been using for several years
contains the following code in order to keep a current age in reports. I has
always worked.

AGE:
Year(Now())-Year([birth])+(DateSerial(Year(Now()),Month([birth]),Day([birth]))>Now())

I have tested the function in the same query as a separate field expr1 etc.
Day([birth]) works, year([birth])works. Why not month([birth]) suddenly?

Now "month([birth]) is undefined and it is so in several other queries which
use this function. [birth] is a complete birthday, eg 12/25/200?

No references appear to be missing at least according to Allen Brown's list.

I really need to solve this as these reports are always in demand.

How would you proceed? I would be very grateful

If you open the VBA editor and select Tools... References, is anything marked
MISSING in *that* list?

John W. Vinson [MVP]
 
F

frankerin

Thanks for responding. I remember you from years ago on devapps. Nice to see
you again.

I checked the references list and none say any are missing. I also tried an
earlier copy of the same database, minus all the added data, and found the
same queries with the same code using month([birth]) with perfect success.
And as I said on this db it worked up through November. I can't think what
changed unless there was a hidden update which might have done something. Any
thoughts? I really need that code to work.
 
F

frankerin

I fixed it. I opened a new database and imported the entire old one, and
testing was successful, the function works as it should. I wish I knew what
happened. Thanks John Vinson for responding.

end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

basage modular 4
Please , help me 1
Running query about date 3
need help creating date related query 6
Table/Filter to show certain months 1
SORTING 5
Dates driving me to drink. 10
Date & Month 1

Top