我正在寻找“日期”列中日期之间的日期差。该查询还将“日期”列转换为yyyy-mm-dd格式,将“文件日期”列转换为仅显示日期。查询正在登台表中执行。我收到此错误,并且似乎很小,但我不知道在哪里以及如何更正它:“在第2行,第19列的语法分析错误:'('附近的语法不正确。”
SELECT
CONVERT([DATE], date) AS Dates,
CAST(filedate AS DATE) AS Filedates,
filesize,
DATEDIFF(DAY, a1.(CONVERT([DATE], date)), a2.(CONVERT([DATE], date))) AS difference
FROM
stage.petsmart a1
INNER JOIN
stage.petsmart a2 ON a2.id = a1.id + 1
WHERE
filesize < 6000