Count Number of Dates on Same Day

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Count Number of Dates on Same Day

Post by burrina »

I am trying to get the number of dates on the same day. In other words if I enter a date that already exists for that day, then warn! Example Below:

tblCatchDetails
CDte Primary Key
CatchDate Date

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Count Number of Dates on Same Day

Post by Rudi »

This could be done by indexing the field. Set the field's Indexed property to Yes (No duplicates).
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
burrina
4StarLounger
Posts: 550
Joined: 30 Jul 2014, 23:58

Re: Count Number of Dates on Same Day

Post by burrina »

I want to be able to allow duplicates, just warn if one exists!

User avatar
HansV
Administrator
Posts: 78446
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Count Number of Dates on Same Day

Post by HansV »

If you want to count the number:
- Activate the Create tab of the ribbon.
- Click Query Design.
- Access displays the Show Table dialog.
- Add tblCatchDetails, then close the dialog.
- Add CatchDate to the query grid, then CDte
- Click to highlight Totals in the Show/Hide group of the ribbon.
- This adds a Total row to the query grid. The default is Group By for each column.
- Change the Total option of CDte to Count.
- Switch to Datasheet View to inspect the result.
Best wishes,
Hans