Solved

MS ACcess 2007 Count query

Posted on 2010-11-18
8
360 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

825 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