HELP COUNT records between two dates!!!! 
Author Message
 HELP COUNT records between two dates!!!!

I have this big table in Acces with lots of records. Every record have a
"date" field.

I wan't to count all records between two dates, and for that I use this SQL
string:
SELECT count(*) FROM v?penregister where ((v?penregister.dato_ut between
#07/01# and #09/30#));

This is working quite well, BUT if the date in one of the many records have
the year 1996, and the rest have 1997, the record with 1996 registered is
not counted!!!!!!!!!!!!

Is there a way to count records in a table no matter what year is
registered in the fields?




Wed, 21 Jul 1999 03:00:00 GMT  
 HELP COUNT records between two dates!!!!

Quote:

> I have this big table in Acces with lots of records. Every record have a
> "date" field.

> I wan't to count all records between two dates, and for that I use this SQL
> string:
> SELECT count(*) FROM v?penregister where ((v?penregister.dato_ut between
> #07/01# and #09/30#));

> This is working quite well, BUT if the date in one of the many records have
> the year 1996, and the rest have 1997, the record with 1996 registered is
> not counted!!!!!!!!!!!!

> Is there a way to count records in a table no matter what year is
> registered in the fields?



Simple.

 SELECT count(*) FROM v?penregister where ((Month(v?penregister.dato_ut) between
 7 and 8 ) AND (DAY(v?penregister.dato_ut) between 1 AND 31));



Wed, 21 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Get date count between two date

2. Need help with Select statement syntax to retrieve Access2000 record between two dates

3. Need help with Select statement syntax to retrieve Access2000 record between two dates

4. Count the months between two dates.

5. How to query all record between two date?

6. SQL: records by years between two date

7. How to print records between two dates with CR6 and VB6

8. How to calculate the difference between two dates (time elapsed between two program starts)

9. Eliminate records of one table based on another table record count

10. Counting records in a record set

11. Record Count in a Record Set

12. Help in Counting Records

 

 
Powered by phpBB® Forum Software