?
Solved

MS ACcess 2007 Count query

Posted on 2010-11-18
8
Medium Priority
?
381 Views
Last Modified: 2012-06-27
Hi,

I trying to get the count of all records that are less or equal to 12/31/2010.
I am getting 0 results where I should have over 2500 count.  But, when I change to > it will return all records count.

Your advice will be appreciated!

Thanks,
Rad


SELECT Count("Starting_Date") AS 2010_Count
FROM My_Table
where "Starting_Date" = #12/31/2010#

Open in new window

0
Comment
Question by:Radshaykho
[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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 28

Accepted Solution

by:
omgang earned 288 total points
ID: 34167121
SELECT Count("Starting_Date") AS 2010_Count
FROM My_Table
where "Starting_Date" <= #12/31/2010#
 
OM Gang
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 860 total points
ID: 34167129
Shouldn't this be:

SELECT Count([Starting_Date]) AS 2010_Count
FROM My_Table
where [Starting_Date <= #12/31/2010#

mx
0
 
LVL 13

Assisted Solution

by:Rick
Rick earned 568 total points
ID: 34167132
SELECT Count("Starting_Date") AS 2010_Count
FROM My_Table
where "Starting_Date" <= '12/31/2010'
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Assisted Solution

by:Rick
Rick earned 568 total points
ID: 34167140
SELECT Count([Starting_Date]) AS '2010_Count'
FROM My_Table
where [Starting_Date] <= '12/31/2010'
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 860 total points
ID: 34167152
Rad:
Your issue is/was your have your field name as a literal String.  It needs to be enclosed in brackets as I posted.

mx
0
 
LVL 28

Expert Comment

by:omgang
ID: 34167172
'MX, missed a closing bracket
where [Starting_Date] <= #12/31/2010#
OM Gang

0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 860 total points
ID: 34167186
One more time then (thx)

SELECT Count([Starting_Date]) AS 2010_Count
FROM My_Table
where [Starting_Date] <= #12/31/2010#
0
 
LVL 3

Assisted Solution

by:Ronald Buster
Ronald Buster earned 284 total points
ID: 34167194
select count([starting_date]) as [2010_count]
from [my_table]
where [starting_Date] = "#12/31/2010#"
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

800 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