Using MS Access/How to - Expression to get number of records between two dates
Expert: Scottgem - 5/10/2005
QuestionI use Access 2000 and am having trouble getting an expression to work. It is a membership database with over 12000 member on it. I produce a report monthly that I have been manually extracting each figure for. What I want to do is configure a text box in a report to look up a specific field in a specific table and then to count the records that fall between two dates. For example I want a total number of members that resigned in a given month. The expression I have been trying is (=dcount [resignationdate], [dbo_members], [resignationdate] =>1/9/2004 and <30/9/2004)
Is this correct or really bad, I can get it to do a greater than or less than or equal to no worries but when I want it between two dates it will not happen. Can you help.
Resignation date is the field name and dbo_members is the table name.
Thanks
Gill
Answer=DCount("[Primarykey]","dbo_members","[ResignationDate] Between #1/9/2004# AND #30/9/2004#)
Primary key should be the name of your primary key field. That's what you want to count. You also need the quotes and brackets as I've shown.
HTH
Scott<>