Solved

MS ACcess 2007 Count query

Posted on 2010-11-18
8
352 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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 28

Accepted Solution

by:
omgang earned 72 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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 215 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 142 total points
ID: 34167132
SELECT Count("Starting_Date") AS 2010_Count
FROM My_Table
where "Starting_Date" <= '12/31/2010'
0
 
LVL 13

Assisted Solution

by:Rick
Rick earned 142 total points
ID: 34167140
SELECT Count([Starting_Date]) AS '2010_Count'
FROM My_Table
where [Starting_Date] <= '12/31/2010'
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 215 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 - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 215 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 71 total points
ID: 34167194
select count([starting_date]) as [2010_count]
from [my_table]
where [starting_Date] = "#12/31/2010#"
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now