Query Problem

Novice1

Registered User.
Local time
Today, 04:31
Joined
Mar 9, 2004
Messages
385
I have a table with the customer sign-in time [TimeIn]. I have another field with a drop down selection of appointment times (e.g., N/A, 7:00, 7:15, 7:30, 7:45, etc.).

In my query I want to sequence the records based on appointment time then [TimeIn]. If there isn't an appointment time (e.g., N/A), then I want to sort based on [TimeIn].

I created this field: CombinedTime: IIf([AppointmentTime]<>"N/A",[AppointmentTime],[TimeIn])

But it doesn't sort as I expected. Is the problem related to using a short text field for the appointment time? I could change the field type (short time) but I want the field to default to "N/A" since most of my customers don't have an appointment.

Any help would be appreciated.
 

Attachments

  • Sort Picture.JPG
    Sort Picture.JPG
    28.1 KB · Views: 62
  • Sort Picture2.JPG
    Sort Picture2.JPG
    29.4 KB · Views: 57
Yes, appointment time being a text field is causing you to get an alphabetic sort. You can try wrapping it in the CDate() function in your formula.
 
Thank you. That did the trick. The new construct works:

CombinedTime: IIf([AppointmentTime]<>"N/A",CDate([AppointmentTime]),[TimeIn])
 

Users who are viewing this thread

Back
Top Bottom