//=============wf_get_col_maxvalue=============// //any wf_get_col_maxvalue (datawindow adw_data, string as_col) //adw_data:要比较列最大值的datawindow //as_col:要比较的列 //return any lany_max //=======================================// string ls_coltype any lany_max datastore lds_temp lds_temp = create datastore //lds_temp.settransobject(sqlca); lds_temp.dataobject = adw_data.dataobject adw_data.rowscopy(1,adw_data.rowcount(),primary!,lds_temp,1,primary!) if lds_temp.rowcount( ) < 1 then return 0 lds_temp.setsort(as_col + ' D') lds_temp.sort( ) ls_coltype = adw_data.Describe(as_col + ".Coltype") if pos(ls_coltype,'text') > 0 or pos(ls_coltype,'char') > 0 then lany_max = lds_temp.getitemstring(1,as_col) elseif pos(ls_coltype,'datetime') > 0 then lany_max = lds_temp.getitemdatetime(1,as_col) elseif pos(ls_coltype,'date') > 0 then lany_max = lds_temp.getitemdate(1,as_col) elseif pos(ls_coltype,'decimal') > 0 then lany_max = lds_temp.getitemdecimal(1,as_col) else lany_max = lds_temp.getitemnumber(1,as_col) end if return lany_max