标题:请大虾们帮帮忙
只看楼主
人王
Rank: 2
等 级:论坛游民
帖 子:20
专家分:22
注 册:2011-7-2
结帖率:25%
已结贴  问题点数:20 回复次数:2 
请大虾们帮帮忙
DLSQL = "SELECT Max([HY]) AS [HY],Min([LY]) AS [LY] FROM ("
DLSQL = DLSQL & " SELECT Max([EX-Time]) AS [HY],Min([EX-Time]) AS [LY] FROM [Expenditure]"
DLSQL = DLSQL & " Union SELECT Max([C-AcceptDate]) AS [HY],Min([C-AcceptDate]) AS [LY] FROM [CreditCard]"
DLSQL = DLSQL & " Union SELECT Max(A.[S-Date]) AS [HY],Min(A.[S-Date]) AS [LY] FROM [G-Title] AS A,(SELECT DISTINCT [G-Number] FROM [GroupMembers] WHERE ([D-Subscribe]+[D-Discount]+[D-RealMeney]+[D-Card]) > 0) AS B WHERE A.[G-Number] = B.[G-Number] "
DLSQL = DLSQL & ")"
我运行后出现下面的信息
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]第 1 行: ')' 附近有语法错误。
数据库连接都是没错的。
大家看看哪里出错了啊,谢谢啦!!!
2012-03-31 10:30
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:20 
你把这段SQL语句的执行语句临时注释掉,然后输出一下运行时的SQL语句看一下
2012-04-03 15:26
人王
Rank: 2
等 级:论坛游民
帖 子:20
专家分:22
注 册:2011-7-2
得分:0 
回复 2楼 yms123
具体怎么弄?不知道怎么办?我是新手。麻烦帮帮忙啊
2012-04-11 09:53



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-364901-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.049597 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved