SELECT Appt_table.id, Appt_table.case_no, Appt_table.appt_time,; Appt_table.appt_duration, Appt_table.cliniccode, Appt_table.remark,; DATEADD(ss, Appt_table.appt_duration*60, Appt_table.appt_time) as end_time; FROM appt_table Appt_table; WHERE Appt_table.appt_time BETWEEN ?weekday1 AND ?weekday2; ORDER BY Appt_table.appt_time, Appt_table.cliniccodeI suppose that you trying to ADD Appt_table.appt_duration minutes to your DateTime, if so, you cuold do that directly:
<pre> SELECT Appt_table.id, Appt_table.case_no, Appt_table.appt_time,; Appt_table.appt_duration, Appt_table.cliniccode, Appt_table.remark,; DATEADD(mi, Appt_table.appt_duration, Appt_table.appt_time) as end_time; FROM appt_table Appt_table; WHERE Appt_table.appt_time BETWEEN ?weekday1 AND ?weekday2; ORDER BY Appt_table.appt_time, Appt_table.cliniccode