Solved

Dcount Syntax issue with multiple Criteria (Year(date)

Posted on 2014-02-26
2
642 Views
Last Modified: 2014-02-26
help with syntax:  I need to determine if records exists where the quarter value = the value of (i) and the Year = current year (Year(date())

              If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter =" & Chr(34) & i & Chr(34) & "" And [Year] = Year(Date)) > 0 Then

             
doesn't like the Year(date()),

Just not seeing the issue.

Please help
0
Comment
Question by:Karen Schaefer
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39890470
Is quarter numeric or text?

If numeric:

 If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter = " & i & " And [Year] = Year(Date())") > 0 Then

Open in new window


If text:

If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter = " & chr(34) & i & chr(34) &  " And [Year] = Year(Date())") > 0 Then

Open in new window

0
 

Author Closing Comment

by:Karen Schaefer
ID: 39890549
If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter = " & chr(34) & i & chr(34) &  " And [Year] = Year(Date())") > 0 Then

Did the trick - thanks
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

776 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