Tquery & FormatDateTime seems to cause GPF

I have finally narrowed down a problem that has cost me a fair bit of
hair. This minimal program gpf's when I close the main form after
doing a select by setting it active. The sql text is :-

select day_one, status_2_date from data_status

there is only one record. I have a dblabel set to receive day_one. The
date does appear correctly. I have removed the query and it is then
Ok. As you can see from the code below I have even set dayone to the
system date to remove the fields[] statement from the problem.

All suggestions gratefully received!!

program Testry;

uses
  Forms,
  Testtry in 'TESTTRY.PAS' {Form1},
  Trydiag in 'TRYDIAG.PAS' {trydialog};

{$R *.RES}

begin
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(Ttrydialog, trydialog);
  Application.Run;
end.

unit Testtry;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses trydiag;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var TheResult:boolean;
begin
   theresult:=trydialog.execute;
end;

end.

unit Trydiag;

interface

uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
  StdCtrls, ExtCtrls, DBCtrls, DB, DBTables, Dialogs, SysUtils;

type
  Ttrydialog = class(TForm)
    OKBtn: TBitBtn;
    CancelBtn: TBitBtn;
    Bevel1: TBevel;
    Query1: TQuery;
    DataSource1: TDataSource;
    DBText1: TDBText;
  private

  { Private declarations }
  public
  Function Execute : boolean;
    { Public declarations }
  end;

var
  trydialog: Ttrydialog;

implementation

{$R *.DFM}

Function TtryDialog.Execute : Boolean;
var dayone,workdate:TDateTime;
    DayOneStr:string;
begin
     query1.active:=true;
     DayOne := Date; {was picking up the field from the select}

     DayOneStr := FormatDateTime('dd-mmm-yy',DayOne); {remove this
line and it works OK}

     if showmodal = mrOK then
          result:=true
      else
          result:=false;
end;

end.

Apologies for long(ish) post but I think it is easier if you see the
program in its entirity,

TIA

=============================================
Sandy Cooper             Software Specialists
MOSSL                    Aberdeen
==============================================
============================================