delphi7 中sql语句引用变量。

2025-02-27 13:08:56
推荐回答(2个)
回答1:

sql:='SELECT B.站名, (SELECT LTRIM(RTRIM(STR(SUM(A.一小时雨量)*0.1 , 9, 1))) FROM tabTimeData A WHERE B.区站号=A.区站号 AND (A.日期时间 = ''' + whereDateTime + ''')) AS '''+h1+'时雨量'+' FROM tabAddress B ORDER BY B.站名';

回答2:

AS '''+h1+'''时雨量,这个H1不要三个引号吧,楼上的搞法是错误的.你换了一个引号试试