423,335 Members | 1,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,335 IT Pros & Developers. It's quick & easy.

Dear I need on help on Dcount with multicriteria

P: 1
I used the following criteria for dcount function but it is not working and giving wrong reply.

Expand|Select|Wrap|Line Numbers
  1. =DCount("[eamvu status]","Primary table","[eamvu status]='stage-II awaited' And [purchase order date]=year(now())")
Hoping for intime response

Anwer Aijaz
Mar 5 '18 #1
Share this Question
Share on Google+
1 Reply


twinnyfo
Expert Mod 2.5K+
P: 2,537
anweraijaz,

Welcome to Bytes!

First, please use Code Tags when posting any code or SQL statements.

Second, if I look closely at your criteria of the DCount function, I see this:
Expand|Select|Wrap|Line Numbers
  1. And [purchase order date]=year(now())
I can only assume that the purchase date is a full date (for example, 2018-03-05), but you are checking to see if it equals a year (for example 2018), not to mention that your sytax is a bit off. This will not produce the results you want.

One method that might work (if you know you are always checking for purchase orders that have occurred within the current year) is this:
Expand|Select|Wrap|Line Numbers
  1. And [purchase order date] >= #" & Year(Now()) & "-01-01#"
Let me know if this hepps out at all
Mar 5 '18 #2

Post your reply

Sign in to post your reply or Sign up for a free account.