Home > Back-end >  Seek help from DElphi a great god, how to query in the SQL statement upon all the data
Seek help from DElphi a great god, how to query in the SQL statement upon all the data

Time:10-14

I now have a table, there is a date field (date), and now want to date field from first month, and then, again according to the obtained in values to query data, my code is this:
The begin
T1:='6';
Clientdataset1. Active:=false;
Clientdataset1.Com mandText:='select * from HUTAI_FEA where intostr (monthof (T))=' "+ t1 +" '"';
//clientdataset1.Com mandText:='select * from HUTAI_FEA where T<"' + t1 +" ';
MandText://clientdataset1.Com='select * from HUTAI_FEA where (select T from HUTAI_FEA)' + inttostr (monthof (DateTime (select T from HUTAI_FEA)));//datetimepicker1. Date
Clientdataset1. Active:=true;
end;

CodePudding user response:

The ORACLE: TO_CHAR

The begin
T1:='6';
Clientdataset1. Active:=false;
Clientdataset1.Com mandText:='select * from HUTAI_FEA where TO_CHAR (T, 'FMMM') ='+ t1 +' ' ' ' ' ';
//clientdataset1.Com mandText:='select * from HUTAI_FEA where T<"' + t1 +" ';
MandText://clientdataset1.Com='select * from HUTAI_FEA where (select T from HUTAI_FEA)' + inttostr (monthof (DateTime (select T from HUTAI_FEA)));//datetimepicker1. Date
Clientdataset1. Active:=true;
end

CodePudding user response:

Inttostr is a function of Delphi, not SQL

Clientdataset1.Com mandText:='select * from HUTAI_FEA where the month (t)=' + t1;

CodePudding user response:

Well,,, when I was on the second floor with the statement, why display FMMM undefined

CodePudding user response:

reference yangtianjiao1 reply: 3/f
well,,, when I was on the second floor in the statement, why display FMMM undefined


Not in 3 floor in Oracle

CodePudding user response:

T is my own edit date field, this format is 2013-6-6

CodePudding user response:

1. What do you use the database?
2. T is what type of data, determine the date type or a string type?
  • Related