By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,462 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,462 IT Pros & Developers. It's quick & easy.

DateSerial Query

P: n/a
Greetings ... I have a table named Harms and Steven with a field named
inspector (text) and inspection date (date/time).

I need to count up how many times the inspector appears for any
inspections occured in 2004.

Here's what I have, but it's giving me problems ... what am I doing
wrong?

Thanks.

WHERE (DateSerial(Year([inspection date]),)=#2004#))

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

ra*********@hotmail.com wrote:
Greetings ... I have a table named Harms and Steven with a field named inspector (text) and inspection date (date/time).

I need to count up how many times the inspector appears for any
inspections occured in 2004.

Here's what I have, but it's giving me problems ... what am I doing
wrong?

Thanks.

WHERE (DateSerial(Year([inspection date]),)=#2004#))


Huh? DateSerial is for converting something to a date... no idea what
you're doing with it.

How about something like:
WHERE Year(InspectionDate)=2004

Nov 13 '05 #2

P: n/a
Designing a "totals" query in the design grid produces:
SELECT [Harms and Steven ].inspectionID, Count([Harms and
Steven ].inspectionID) AS CountOfinspectionID FROM [Harms and Steven ]
WHERE ((([Harms and Steven ].[inspection date]) Between #1/1/2004# And
#12/31/2004#))
GROUP BY [Harms and Steven]. inspectionID
- where "inspectionID" = the unique inspection record key field

-Ed

<ra*********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Greetings ... I have a table named Harms and Steven with a field named
inspector (text) and inspection date (date/time).

I need to count up how many times the inspector appears for any
inspections occured in 2004.

Here's what I have, but it's giving me problems ... what am I doing
wrong?

Thanks.

WHERE (DateSerial(Year([inspection date]),)=#2004#))

Nov 13 '05 #3

P: n/a
The DateSerial function requires 3 arguments: a year, a month and a day.

Try WHERE Year([inspection date]) = 2004

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

<ra*********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Greetings ... I have a table named Harms and Steven with a field named
inspector (text) and inspection date (date/time).

I need to count up how many times the inspector appears for any
inspections occured in 2004.

Here's what I have, but it's giving me problems ... what am I doing
wrong?

Thanks.

WHERE (DateSerial(Year([inspection date]),)=#2004#))

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.