我正在将数据库从SQL Server转换为Access,一切正常,我从SQL Server数据库创建了一个Access文件但是当我运行程序时,在某些形式中,会发生异常。它是一个VB.Net应用程序,当我使用下面给出的SQL语句时,会发生异常。
错误
SELECT语句包含拼写错误或缺失的保留字或参数名称,或者标点符号不正确。
代码:
SELECT
fee.TodayDate AS Date, fee.ReceiptNo,
reg.RegistrationNo, reg.FirstName + ' ' + reg.LastName AS Name,
class.Class, reg.Category, fee.TotalFees, fee.OldBalance,
fee.LateFees, fee.Concession, fee.Discount, fee.Scholarship,
(fee.TotalFees + fee.LateFees + fee.OldBalance) -
(fee.Discount + fee.Scholarship + fee.Concession) AS NetFees,
fee.AmountReceived, fee.Balance
FROM
txnFeePayment AS fee
INNER JOIN
tbStudentInfo AS student ON fee.StudentID = student.StudentID
INNER JOIN
mstClass AS class ON student.ClassID = class.ClassID
INNER JOIN
tbStudentRegistration AS reg ON student.RegistrationID = reg.RegistrationID
WHERE
(fee.TodayDate BETWEEN @From AND @To)
AND (reg.Regular = 'True')
AND fee.SessionID = @sessionid
请帮助我找到问题所在..我需要快速解决方案,谢谢
答案 0 :(得分:0)
Name
是Ms Ms中的保留字。你应该这样括起来:[Name]