Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Incident Reports » Incident Reports Reported for Version 3.07 » View Incident Report |
Serious |
Reported By: Michael Haralabos Reported On: 3/13/2002 For: Version 3.07 Build 1 |
{ This doesn't work } procedure TMainForm.Button1Click(Sender: TObject); begin with MainForm, Query do begin with Sql do begin Clear; Add('Select RECORDID, NAME, ' + 'EXTRACT(DAY FROM CAST(START AS DATE)) AS DAY, START, FINISH,' + '((FINISH - START) / 3600000) as HOURS'); // The Start & Finish fields are defined after the "Extract" // with the result the "Finish" field not to appear on DBGrid Add('From Data'); Add('Where CAST(START AS DATE) Between :StartDate and :EndDate'); Params[0].AsDate := EncodeDate(2002, 3, 1); Params[1].AsDate := EncodeDate(2002, 3, 31); end; DisableControls; Open; First; TFloatField(FieldByName('HOURS')).Precision := 3; EnableControls; end; end; { This works } procedure TMainForm.Button2Click(Sender: TObject); begin with MainForm, Query do begin with Sql do begin Clear; Add('Select RECORDID, NAME, START, FINISH, ' + 'EXTRACT(DAY FROM CAST(START AS DATE)) AS DAY, ' + '((FINISH - START) / 3600000) as HOURS'); // The Start & Finish fields are defined BEFORE the "Extract" // which gives the correct result with the "Finish" field visible // on the DBGrid ... Should i except the same result on the // Previous(Button1Click) SQL too ? Add('From Data'); Add('Where CAST(START AS DATE) Between :StartDate and :EndDate'); Params[0].AsDate := EncodeDate(2002, 3, 1); Params[1].AsDate := EncodeDate(2002, 3, 31); end; DisableControls; Open; First; TFloatField(FieldByName('HOURS')).Precision := 3; EnableControls; end; end;
This web page was last updated on Wednesday, March 20, 2024 at 07:22 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |