我正在尝试编写一个简单的查询来查找字段“peak_demand”大于50的任何记录。出于某种原因,我收到了标题中提到的错误。我试图阅读有关此错误的信息,它们似乎都与字符串有关。我的查询中没有LEFT或SUBSTRING函数。以下是我的查询文字。
select mm.fldmeterid "Meter#", dbo.fn_dt(dbo.fn_lt(rdv.sample_point,786)) "Read-Date-Time", mm.fldrepid , rdv.read_value_sum, peak_demand
from read_master_e rm
left outer join read_detail rd on rm.endpoint_id=rd.endpoint_id and rm.sample_point=rd.sample_point
left outer join read_detail_value rdv on rdv.endpoint_id=rd.endpoint_id and rdv.sample_point=rd.sample_point
left outer join tblmetermaint mm on (mm.FLDREPID= rm.endpoint_id)
where peak_demand > 50
order by rdv.sample_point desc