MS ACcess 2007 Count query

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

RadshaykhoAsked:
Who is Participating?
 
omgangIT ManagerCommented:
SELECT Count("Starting_Date") AS 2010_Count
FROM My_Table
where "Starting_Date" <= #12/31/2010#
 
OM Gang
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Shouldn't this be:

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

mx
0
 
RickCommented:
SELECT Count("Starting_Date") AS 2010_Count
FROM My_Table
where "Starting_Date" <= '12/31/2010'
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
RickCommented:
SELECT Count([Starting_Date]) AS '2010_Count'
FROM My_Table
where [Starting_Date] <= '12/31/2010'
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
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
 
omgangIT ManagerCommented:
'MX, missed a closing bracket
where [Starting_Date] <= #12/31/2010#
OM Gang

0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
One more time then (thx)

SELECT Count([Starting_Date]) AS 2010_Count
FROM My_Table
where [Starting_Date] <= #12/31/2010#
0
 
Ronald BusterOwnerCommented:
select count([starting_date]) as [2010_count]
from [my_table]
where [starting_Date] = "#12/31/2010#"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.