Solved

Dcount Syntax issue with multiple Criteria (Year(date)

Posted on 2014-02-26
2
659 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
[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 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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