473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

DCount in Access 2010 Query

Hi, I have a query that pulls in hours for multiple Subprojects by Month and Year. To be able to compare data I need to Count the Month & Year for each subproject. Example Subproject1 11/2011 would be 1, Subproject 1 12/2011 would be 2, and Subproject2 3/2009 would be 1. So, I am trying to use a DCount in an Access 2010 query. This is my SQL:
Expand|Select|Wrap|Line Numbers
  1. SELECT qLbrEstModelBaseHours.SUBPROJECTID, qLbrEstModelBaseHours.FISCALYEAR, qLbrEstModelBaseHours.ACCOUNTINGPERIOD, qLbrEstModelBaseHours.FiscalYearMonth, CInt(DCount("FiscalYearMonth","qLbrExtModelBaseHours"," FiscalYearMonth <=" & [FiscalYearMonth])) AS [Month]
  2. FROM qLbrEstModelBaseHours
  3. GROUP BY qLbrEstModelBaseHours.SUBPROJECTID, qLbrEstModelBaseHours.FISCALYEAR, qLbrEstModelBaseHours.ACCOUNTINGPERIOD, qLbrEstModelBaseHours.FiscalYearMonth;
I am getting a #Error instead of a count. I have attached a snapshot of my results.
Can you tell me what I am doing wrong?
Thank you for your assistance.
Attached Images
File Type: jpg DCountQueryResults.jpg (32.6 KB, 403 views)
Oct 21 '13 #1

✓ answered by Rabbit

I'm pretty sure DCount is the wrong way to go with this but you're not really clear on what it is you're trying to do.

Anyways, the problem is that in one place, you call it qLbrEstModelBaseHours, but in the other, you call it qLbrExtModelBaseHours. One of them is wrong.

3 2159
Rabbit
12,516 Expert Mod 8TB
I'm pretty sure DCount is the wrong way to go with this but you're not really clear on what it is you're trying to do.

Anyways, the problem is that in one place, you call it qLbrEstModelBaseHours, but in the other, you call it qLbrExtModelBaseHours. One of them is wrong.
Oct 22 '13 #2
NeoPa
32,556 Expert Mod 16PB
Rabbit's second paragraph is the answer to your question, but their first is far more important. If you're clever you'll pay more attention to that the just the quick fix to the runnability of the query ;-)
Oct 22 '13 #3
Rabbit, thanks for finding my typo. I hear you about the DCount not being the solution. I will start a new thread and try to better explain what I need to do.
Oct 24 '13 #4

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

Similar topics

5
by: jaad | last post by:
Hello, I have a database that was written in access 2007 on my pc. I wanted to work off site with the database so I uploaded it onto my laptop which is loaded with access 2010 beta. When I...
2
by: sierra7 | last post by:
It seems Access 2010 is associating an 'input mask' or field type with a combo box when a form is opened, even though there is no Format setting on the control. I have a form which has been...
1
by: Alan Yim | last post by:
Hi folks, My company recently upgraded our Office suite from 2003 to 2010. The problem in particular is with an Access database that was originally designed in Access 2003. The code in question...
4
by: jbrumbau | last post by:
Hello, In Access 2010/2007, how do you prevent users from flipping into design view from the ribbon? I do not want to hide the entire ribbon (DoCmd.ShowToolbar "Ribbon", acToolbarNo) or even the...
3
by: john latona | last post by:
hi! i realize that access 2010 does not have the username and password function built into it, so i am trying to build it into my db. i have a "login form" with text fields titled username and...
4
beacon
by: beacon | last post by:
Hi everybody, My title may not exactly describe my issue, so please forgive my lack of creativity today. I've got a database that was created in Access 2003 that I've opened in Access 2010. I...
17
twinnyfo
by: twinnyfo | last post by:
Hey coders, Has anyone heard anything about the Date() function no longer working (or working differently in MS Access 2010? I have an MS Access 2007 DB that has worked perfectly, however, we...
7
dgaletar
by: dgaletar | last post by:
To start off, I am a serious "newbe" to Access, and have probably made countless mistakes thus far in the design of this database. I work as a fleet mechanic for a University in DC, and am trying...
10
by: jacekwbak | last post by:
Hello, I have following problem: table1 id / ArticleCode / ArticleColor 1 / 123 / blue 2 / 123 / blue 3 / 222 / green 4 / 333 / red
11
by: Redbeard | last post by:
I have just upgraded to Access 2010 (64 bit) from Access 2007. There were a few minor issues in the database which I have resolved but this one piece of code just won’t work. I do not write VBA but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.