?
Solved

Combination criteria for unbound field on a report

Posted on 2015-01-19
5
Medium Priority
?
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 52

Expert Comment

by:Gustav Brock
ID: 40558566
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 1000 total points
ID: 40558568
= 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
ID: 40558605
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 52

Accepted Solution

by:
Gustav Brock earned 1000 total points
ID: 40558648
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
ID: 40558657
Awarded to both of you because I changed the rules mid-stream.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

650 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