Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old June 27th, 2008, 08:26 PM
cjcn
Guest
 
Posts: n/a
Default Limiting records based on dates

I am creating a database that is like an appointment system where users can
book appointments for a predefined date but there are a limited number of
appointments for that date e.g. June 15, 2008 = 30 appointments, June 16,
2008 = 25 appointments.

What would be the best approach ?

CJCN

  #2  
Old June 27th, 2008, 08:26 PM
banem2@gmail.com
Guest
 
Posts: n/a
Default Re: Limiting records based on dates

On Jun 4, 4:08*am, "cjcn" <u44045@uwewrote:
Quote:
I am creating a database that is like an appointment system where users can
book appointments for a predefined date but there are a limited number of
appointments for that date e.g. June 15, 2008 = 30 appointments, June 16,
2008 = 25 appointments.
>
What would be the best approach ?
>
CJCN
You can use (slow) DCount() function to count appointments for
selected date and compare result with given number of max
appointments.

If there are lots of data and DCount() works really slow, you can use
SQL which counts appointments by date, like:

SELECT tblTable.Date, Count(tblTable.Date) AS CountOfAppointments
FROM tblTable
GROUP BY tblTable.Date;

and then use one of the methods to read the number of appointments by
date (Dlookup(), rst.FindFirst, etc). Once you have the number for
desired date you can compare it with max number of appointments for
that date and allow/disallow adding new appointment.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles