• Access 97 problem (97)

    Author
    Topic
    #376918

    I am trying to model a Dentist’s appointment system. I have created a query that calculates the time an appointment finishes for a particular dentist using start time and treatment length located in different tables. I wish to display the start time for the next available appointment on the Booking form. Is there a way I can compare the time value in each record of my query and determine the time difference between them? If this difference is greater than 35 minutes then the first record that matches the condition is selected. Or is there a more effeicient way? Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #619145

      If I understand correctly, you have a known endtime for the current appointment, and you want to find all the available timeslots where the next appointment can be made??? The first slot where the time difference is > 35 minutes is to be selected???

      (aircode)

      SELECT * from tblAppointmentSlots where (datediff(“nn”,[CurrentEndTime],[AppointmentStartTime]) > 35) and (datediff(“nn”,[CurrentEndTime],[AppointmentStartTime]) < 240) ORDER BY AppointmentStartTime

      should give you a list of all the candidate time slots.

      • #619512

        Many thanks for your help. Unfortunately, I am getting syntax error messages when I use the expression you supplied. I substituted the table and field names for those in my database. A little more guidance as to using the expression would be greatly appreciated.

    • #619352

      This subject has been discussed many times. Do a Lounge Search on scheduling to see some of the previous threads.

    Viewing 1 reply thread
    Reply To: Access 97 problem (97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: