MS Access: unbound text box for dcount with date parameters -
i have 2 tables in 1-many relationship:
person - application
every time person meets criteria, new record created in application, , today’s date added field app_outawarddate
.
i want add unbound text box person form display, on selecting person’s record, number of times app_outawarddate
has been populated in last 28 days, counting number of applications in last 4 weeks.
in way worker warned before progressing may not eligible further award @ time.
i’ve been using following, returns ‘0’:
=dcount("app_perid","application","app_outawarddate" between date() , date()-28)
person table
per_id = primary key
application table
app_id = primary key app_perid = foreign key (for person) app_outawarddate
i have near 0 experience of calculated fields, gratefully received.
red
the 3rd argument of dcount
must valid sql string.
for between
, dates must in correct order (between earlier , later).
to check date, use
=dcount("app_perid","application","app_outawarddate between date()-28 , date()")
to check current person, need this:
=dcount("app_perid","application", "(app_outawarddate between date()-28 , date()) , app_perid = " & [perid])
[perid]
refers form control containing current person id. needs concatenated, because dcount can't resolve if it's inside string.
Comments
Post a Comment