P
PayeDoc
Hello All
I have:
SELECT practices.[prac name], DSum("[x confirmed]![ni ees and ers 1e]","[x
confirmed]","[x confirmed]![dname]=[dname] And [x confirmed]![month
number]>=140") AS total_ni,
DLookUp("[months]![number]","[months]","[months]![month name]=[staff bank
name]") AS mthnum, staffs.[staff bank name]
FROM practices INNER JOIN staffs ON practices.[prac name] = staffs.practice
WHERE (((practices.[prac name])=[Forms]![frm x main]![prac name]));
.... but for some unfathomable reason this errors with a message that access
can't find [staff bank name]. But [staff bank name] is definitely in table
[staffs], and in fact if I remove the field 'mthnum' the query runs fine -
and includes the values of [staff bank name] perfectly happily! I have tried
replacing [staff bank name] with [staffs]![staff bank name] in the field
'mthnum', but this makes no difference.
What I really want to do is use the value of 'mthnum' instead of the
currently hard-coded "140" in the field total_ni.
What's up?
Hope someone can help.
Many thanks
Leslie Isaacs
I have:
SELECT practices.[prac name], DSum("[x confirmed]![ni ees and ers 1e]","[x
confirmed]","[x confirmed]![dname]=[dname] And [x confirmed]![month
number]>=140") AS total_ni,
DLookUp("[months]![number]","[months]","[months]![month name]=[staff bank
name]") AS mthnum, staffs.[staff bank name]
FROM practices INNER JOIN staffs ON practices.[prac name] = staffs.practice
WHERE (((practices.[prac name])=[Forms]![frm x main]![prac name]));
.... but for some unfathomable reason this errors with a message that access
can't find [staff bank name]. But [staff bank name] is definitely in table
[staffs], and in fact if I remove the field 'mthnum' the query runs fine -
and includes the values of [staff bank name] perfectly happily! I have tried
replacing [staff bank name] with [staffs]![staff bank name] in the field
'mthnum', but this makes no difference.
What I really want to do is use the value of 'mthnum' instead of the
currently hard-coded "140" in the field total_ni.
What's up?
Hope someone can help.
Many thanks
Leslie Isaacs