By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

Problem using calculated expression within Dcount

P: 10
Hello,

All help is appreciated, I'm struggling with the following.

Using Access 2003 (front end) connecting to Oracle 7 database (back end). I'm trying to create a query in access that will show how many instances of something happens.

Within the query I am using a calculated filed called "registered".The syntax is

Registered: DateDiff("w",[date_valid],[timestamp])

This returns a number 0.00, 1.00, 2.00 etc

Within the query or form (I've tried both), I'm trying to count the number times that 0.00 appears. I will then take this figure and use it to calculate the percentage. My problem is when using the dcount function to count the instances that something appears. I've tried the following

DCount("salary","Applications","registered=0.00")

This is where the errors start, I've also tried

DCount("salary","Applications","(DateDiff(""w"",[date_valid],[timestamp]))=1.00")

but this also errors with the same message. The error message always refers to "Start Date" which is one of the parameters of "date_valid" (the other being "End Date"). I've removed this parameter but it still asks for it.

Where am I going wrong?
Apr 23 '07 #1
Share this Question
Share on Google+
3 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
In a new query based on the first query ...
Expand|Select|Wrap|Line Numbers
  1. Count0: Sum(IIf(Registered=0.00,1,0))
  2. Count1: Sum(IIf(Registered=1.00,1,0))
  3. Count2: Sum(IIf(Registered=2.00,1,0))
  4.  
Mary
Apr 24 '07 #2

P: 10
In a new query based on the first query ...
Expand|Select|Wrap|Line Numbers
  1. Count0: Sum(IIf(Registered=0.00,1,0))
  2. Count1: Sum(IIf(Registered=1.00,1,0))
  3. Count2: Sum(IIf(Registered=2.00,1,0))
  4.  
Mary
Thanks for that, you have solved my problem, I didn't know about the IIF function.

Thanks again
Apr 24 '07 #3

MMcCarthy
Expert Mod 10K+
P: 14,534
Thanks for that, you have solved my problem, I didn't know about the IIF function.

Thanks again
You're welcome.
Apr 24 '07 #4

Post your reply

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