本文介绍了ASP中的Microsoft VBScript编译错误“800a0401”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 运行程序时,我收到此错误 Microsoft VBScript编译错误''800a0401'' 预计结束声明 /admin/currentmonth.asp,第26行 strSQL =" SELECT RFCInfo.Name,RFCInfo.Date,RFCInfo。 RFCN,RFCInfo.InvNo,RFCInfo.Deleted,InvoiceDetail.Quantity,InvoiceDetail.Description,InvoiceDetail.ExtendedPrice,InvoiceInfo.GST,InvoiceInfo.PST,InvoiceInfo.Total FROM RFCInfo INNER JOIN(InvoiceDetail INNER JOIN InvoiceInfo ON InvoiceDetail.InvNo = InvoiceInfo.InvNo )在RFCInfo.InvNo = InvoiceInfo.InvNo,其中RFCInfo.DealerID =" &安培; strDealerID& " AND RFCInfo.Deleted = FALSE和RFCInfo.Date介于Date()和DateAdd(" m", - 1,Date())之间按RFCInfo.Date排序" ------- -------- ^ i需要显示最近一个月的记录,3个月的记录,6个月的记录和1年的单独记录。现在我要显示1个月的记录。但是在运行此代码时,在m下的这个sql语句中(在Date()和DateAdd(" m", - 1,Date())之间发生错误。 我正在使用ASP和Ms Access作为数据库。 任何人都知道为什么会出现这个错误。这是我们显示最近1个月记录的方式...如果我们将-1更改为-3,-6和所有最后3个月,那么最后6个月将被发现是正确的。 提前谢谢。While running the program, i''m getting this errorMicrosoft VBScript compilation error ''800a0401''Expected end of statement/admin/currentmonth.asp, line 26strSQL = "SELECT RFCInfo.Name, RFCInfo.Date, RFCInfo.RFCNo, RFCInfo.InvNo, RFCInfo.Deleted, InvoiceDetail.Quantity, InvoiceDetail.Description, InvoiceDetail.ExtendedPrice, InvoiceInfo.GST, InvoiceInfo.PST, InvoiceInfo.Total FROM RFCInfo INNER JOIN (InvoiceDetail INNER JOIN InvoiceInfo ON InvoiceDetail.InvNo = InvoiceInfo.InvNo) ON RFCInfo.InvNo = InvoiceInfo.InvNo where RFCInfo.DealerID =" & strDealerID & " AND RFCInfo.Deleted = FALSE And RFCInfo.Date Between Date() And DateAdd("m",-1,Date()) Order By RFCInfo.Date"---------------^i need to display last one months records,3 months records, 6 month records and 1 yrs records seperatly. now i''m tring to display 1 month records. but while running this codes, in this sql statement under the "m" (Between Date() And DateAdd("m",-1,Date()) ) error occurs.and i''m using ASP with Ms Access as database.anyone have any idea why this error occurs. is this the way we can display the last 1 month records... like wise if we change the -1 to -3,-6 and all the last 3 months, last 6 months will be found out right.Thanks in advance.推荐答案 展开 | 选择 | Wrap | 行号 两个函数date()和dateAdd()需要在用于生成查询字符串的引号之外。尝试:The two functions date() and dateAdd() need to be outside the quotes used to make the query string. Try: 展开 | 选择 | Wrap | 行号 这篇关于ASP中的Microsoft VBScript编译错误“800a0401”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 14:10