Do you want to count appointments? Then something like:
=Count(If([End Time] - [Start Time] > 30 / (24 * 60), AppointmentID))
(Interval() and Date() are merely formatting functions, they have no effect on the underlying value. 30 / (24 * 60) is the value of 30 minutes. You could also use Time#('00:30:00'))
Do you have valid date values? The code assumes the Start Time and End Time are time or time-stamp numeric values, and not strings.
And that both time are correctly associated with the Appointment IDs.
I suggest that you share a small sample qvf that illustrates the problem and someone may be able to pinpoint the problem.