Grouping data for time series graph

I am new to grafana. Using SQL Server as the data source creating time series graph using a table appointment having DateTime column appoinmentDateTime have to show the count of appointment in 30 min time slot. example say 10 appointment at 10:00 am 15 appointment at 10:30 am. How can I achieve this?