?
Solved

Combination criteria for unbound field on a report

Posted on 2015-01-19
5
Medium Priority
?
166 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 51

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 51

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 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