L
Leslie Isaacs
Hello All
I have a report [rpt summary] that is based on table [x confirmed]. The
table includes the following fields:
[month no] (integer)
[name] (text)
[tax code no] (integer)
First of all, I should say that I have 'inherited' this db, so the naming of
field [name] was not my doing! It is however firmly embeded throughout the
various queries, reports and forms, and the db works, so it will have to
stay.
Table [x confirmed] contains many records with the same value in [name]
(i.e. for each person), but for each of these records there is always a
different value for [month no] (i.e. each person is only in the table once
for each month number).
I need to create a new textbox on the report that gives, for each person,
the value of [tax code no] that occurs with that person's highest value of
[month no] that is between 73 and 84 (inclusive). This textbox will be in
the report's detail section, where there is already a field [name].
I have tried using this DLookup function:
=DLookup ("[tax code no]", "[x confirmed]", "[name]=[reports].[rpt
summary].[name] and [month no] = DMax ("[month no]","[x confirmed]","[name]=
[reports].[rpt summary].[name] and [month no] > 72 and [month no] < 85")")
When this just gave me #ERROR I suspected the [name] field, so I renamed it
as [person] in the report and tried:
=DLookup ("[tax code no]", "[x confirmed]", "[name]=[reports].[rpt
summary].[person] and [month no] = DMax ("[month no]","[x
confirmed]","[name]= [reports].[rpt summary].[person] and [month no] > 72
and [month no] < 85")")
.... but with the same result.
Am I on the right lines (is it just my syntax?), or is there a better way of
getting this?
I hope someone can help.
Many thanks
Les lie Isaacs
I have a report [rpt summary] that is based on table [x confirmed]. The
table includes the following fields:
[month no] (integer)
[name] (text)
[tax code no] (integer)
First of all, I should say that I have 'inherited' this db, so the naming of
field [name] was not my doing! It is however firmly embeded throughout the
various queries, reports and forms, and the db works, so it will have to
stay.
Table [x confirmed] contains many records with the same value in [name]
(i.e. for each person), but for each of these records there is always a
different value for [month no] (i.e. each person is only in the table once
for each month number).
I need to create a new textbox on the report that gives, for each person,
the value of [tax code no] that occurs with that person's highest value of
[month no] that is between 73 and 84 (inclusive). This textbox will be in
the report's detail section, where there is already a field [name].
I have tried using this DLookup function:
=DLookup ("[tax code no]", "[x confirmed]", "[name]=[reports].[rpt
summary].[name] and [month no] = DMax ("[month no]","[x confirmed]","[name]=
[reports].[rpt summary].[name] and [month no] > 72 and [month no] < 85")")
When this just gave me #ERROR I suspected the [name] field, so I renamed it
as [person] in the report and tried:
=DLookup ("[tax code no]", "[x confirmed]", "[name]=[reports].[rpt
summary].[person] and [month no] = DMax ("[month no]","[x
confirmed]","[name]= [reports].[rpt summary].[person] and [month no] > 72
and [month no] < 85")")
.... but with the same result.
Am I on the right lines (is it just my syntax?), or is there a better way of
getting this?
I hope someone can help.
Many thanks
Les lie Isaacs