Solved

# Dcount Syntax issue with multiple Criteria (Year(date)

Posted on 2014-02-26
Medium Priority
671 Views
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.

0
Question by:Karen Schaefer
[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

LVL 61

Accepted Solution

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

If numeric:

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

If text:

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

Author Closing Comment

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

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
###### Suggested Courses
Course of the Month15 days, 5 hours left to enroll