-
date + hour
I want to get the count of id for a date and hour
06/09/2004 09:19:00
for the date = 06/09/2004
i want the count of ID for the hour = 09
for access 2000
SELECT COUNT users.id WHERE users.dates = #06/09/2004# AND hour(users.dates) = #9#
(i dont want to have to write the 0 of 09)
it doesn't work
with variable of course
SELECT COUNT users.id WHERE users.dates = #[@date]# AND hour(users.dates) = #[@hour]#
thank you
-
i cannot get it
nobody knows ?
thanks a lot
-
Have you tried it without the #'s around the hour? hour() should be returning an integer.
hour(users.dates) = 9
-
no i get nothing
the only heavy way i get what i want is
SELECT user.id,
Year([inscription]) AS year,
Month([inscription]) AS month,
Day([inscription]) AS day,
Hour([inscription]) AS hour
FROM user
WHERE (((Year([inscription]))=[@year])
AND ((Month([inscription]))=[@month])
AND ((Day([inscription]))=[@day])
AND ((Hour([inscription]))=[@hour]));
Last edited by gwendaal; 02-26-2005 at 05:03 AM.
-
Those functions return integer values, so it should work if inscription = #06/09/2004 09:19:00# (assuming mm/dd/yyyy date format):
SELECT user.id,
Year([inscription]) AS year,
Month([inscription]) AS month,
Day([inscription]) AS day,
Hour([inscription]) AS hour
FROM user
WHERE Year([inscription]) = 2004
AND Month([inscription]) = 6
AND Day([inscription]) = 9
AND Hour([inscription]) = 9;
-
yes that's my method and it works fine .... i am using 4 variable ...
thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|