Solved

Dcount Syntax issue with multiple Criteria (Year(date)

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…

733 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