数据库保存的是字符串型; 在这怎么转换成float啊使用Copy函数,从字符串中截取出数值部分,然后strtofloat函数转换 with DBChart do begin Series1.DataSource:=CDSData; Series1.XLabelsSource:= 'CreateTime'; Series1.YValues.ValueSource := Copy(CDSData.fieldbyname('Roll').AsString,2,2); end; 这样写也不行;怎么把字段赋给Y轴。
双击DBchart打开属性面板,选择你要设置的曲线,然后就可以选择字段
体重TZ保存的是65还是65KG啊;我的还是提示
在查询语句中去掉单位,使用substring函数
procedure TForm2.FormCreate(Sender: TObject); var S,a :String; begin S:= '-27`'; a:=Copy(S,pos('-',S),3); Showmessage(a); end;取得-27
select convert(numerc,left(字段名,len(字段名-1) as 数值度数 from 表名
select convert(numerc,left(字段名,len(字段名)-1) as 数值度数 from 表名
select convert(numerc,left(字段名,len(字段名)-1) as 数值度数 from 表名 OK 了 谢谢大侠
使用Copy函数,从字符串中截取出数值部分,然后strtofloat函数转换
with DBChart do
begin
Series1.DataSource:=CDSData;
Series1.XLabelsSource:= 'CreateTime';
Series1.YValues.ValueSource := Copy(CDSData.fieldbyname('Roll').AsString,2,2);
end; 这样写也不行;怎么把字段赋给Y轴。
var
S,a :String;
begin
S:= '-27`';
a:=Copy(S,pos('-',S),3);
Showmessage(a);
end;取得-27
select convert(numerc,left(字段名,len(字段名)-1) as 数值度数 from 表名
select convert(numerc,left(字段名,len(字段名)-1) as 数值度数 from 表名
OK 了 谢谢大侠