Dear All:Do you happen to it?
Dear All:
Please given Some Advice,ths!
enviroment: win2000,delphi5,
database engine: sqlAnywhere5.0
win200 system date format 'yy-mm-dd'
use AdoQuery to insert a date format data to a table ,
procedure TForm1.adotestClick(Sender: TObject);
begin
with ado do
begin
close;
sql.clear;
sql.Add('insert into test(f1) values(:date)');
parameters.ParamByName('date').value :=dx.asdatetime;//Dx is a component
that has initialized as '2001-12-12';
execsql;
end;
end;
initialization
ShortDateFormat:= 'YYYY-MM-DD';
DateSeparator := '-';
end.
after executed , use sqlAnywhere to query as following
'select convert(char(12),f1) from test ' the result is
'dec 12 1901' not 'dec 12 2001'
but use Tquery or set the date format 'yyyy-mm-dd' the result is correct;
how can i do??????