Solved

Combination criteria for unbound field on a report

Posted on 2015-01-19
5
151 Views
Last Modified: 2015-01-19
What is wrong with this syntax?

= DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True") AND "[AwardedDate]" = Between Forms!frmSelectDateRange.txtStart and Forms!frmSelectDateRange.txtEnd

I'm trying to count the number of Trues in a table within a date range specified on an open form.

--Steve
0
Comment
Question by:SteveL13
  • 2
  • 2
5 Comments
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
It should be something like this:

=DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True And [AwardedDate] Between DateValue(" & Forms!frmSelectDateRange.txtStart & ") And DateValue(" & Forms!frmSelectDateRange.txtEnd & ")")

/gustav
0
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 250 total points
Comment Utility
= DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True AND [AwardedDate] Between " & Forms!frmSelectDateRange.txtStart & " and " & Forms!frmSelectDateRange.txtEnd)

Assuming that the dates are in date format. May need #s around the dates as well, as in #01/02/2014#
0
 

Author Comment

by:SteveL13
Comment Utility
I have to change this and will issue a new request if needed.  The form is NOT going to be open so I have to use the report criteria something like:  (which is not working)

=DCount("[AwardedClient]", "tblClientGeneral", "[AwardedClient]= True And [AwardedDate] Between DateValue(" & Reports!rptImportAnalytics.txtWeekstartingdate & ") And DateValue(" & Reports!rptImportAnalytics.txtWeekstartingdate & ")+7")
0
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 250 total points
Comment Utility
Question is if the fields holds a value. Try first:

=DateValue(" & Reports!rptImportAnalytics.txtWeekstartingdate & ")

or simply:

=DateValue([txtWeekstartingdate])

/gustav
0
 

Author Closing Comment

by:SteveL13
Comment Utility
Awarded to both of you because I changed the rules mid-stream.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now