473,473 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DateSerial Query

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

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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says...
1
by: PMBragg | last post by:
ORINGINAL Post >Thank you in advance. I'm trying to pull all inventory items from December >of the previous year back to 4 years for my accountant. I know this can be >done, but I'm drawing a...
5
by: Jeremy Wallace | last post by:
I have some code that uses DateSerial to populate a couple of text boxes on a form. I was doing some testing this afternoon and found that I get funny values if the year supplied is 99. 98 works...
3
by: ralph_noble | last post by:
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...
1
by: Kenny | last post by:
I am having issues with the "Date.ToOADate" method in VB .NET. I understand that in VB6 the function DateSerial gives an internal representation of the date. When I use the DateSerial method in...
5
by: jerry.ranch | last post by:
I see that DateSerial can be used to "concatenate", in a way, three fields DateSerial(year, month day) into a date field (if year , month and date are numeric values). Unfortunately, my Month...
1
by: woooopa | last post by:
Something like this... MAX (DateSerial(!,!,!))
3
by: RZ15 | last post by:
Hi, I have a query that calculates the sum of branch transfers for the current quarter. Here is my Quarter-to-Date field: QTD-In: Sum(CCur(IIf(="TRN" And Between...
3
by: ringer | last post by:
On a form I have a combo where a month is entered. It shows the month names in column one, but it is bound to column two where each month's corresponding number is, ie Jan=1, Feb=2, etc. So...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.