Solved

Dcount Syntax issue with multiple Criteria (Year(date)

Posted on 2014-02-26
2
631 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
Comment Utility
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
Comment Utility
If DCount("Quarter", "tblSummaryQuartersFrozen", "Quarter = " & chr(34) & i & chr(34) &  " And [Year] = Year(Date())") > 0 Then

Did the trick - thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

772 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

12 Experts available now in Live!

Get 1:1 Help Now