I have the following code:
procedure TForm10.AdvSmoothCalendar1SelectDate(Sender: TObject;
Mode: TAdvSmoothCalendarDateMode; Date: TDateTime);
begin
selecteddate := FormatDateTime('yyyy-mm-dd',AdvSmoothCalendar1.SelectedDate)+'%';
MyQuery1.Close();
MyQuery1.SQL.Text := 'SELECT STARTTIME,Video_Server,Type FROM video_files where Site_No = 82 AND STARTTIME LIKE '+'"' + selecteddate+ '"' +' ORDER BY STARTTIME , Video_Server';
Edit2.text := MyQuery1.SQL.Text;
MyQuery1.Open();
end;
When the grid populates I get the correct result but I would expect the columns to be in the same order as the query. ie StartTime,Video_server,type but I get Video_Server,STARTTIME,type.
Also how do I set the column width to expand to the width of the data in the cells automatically.
Cheers
SteveW