2014-10-29 43 views
0

任何人都可以请指教?新来这...我最初得到一个“无效不是空”的错误,并在我修改后,我现在得到语法错误。不是空语法错误

'Add notes about employee 
strsql = "SELECT [Employee Number], Declination, Leave, Termed, Comments " 
strsql = strsql & "FROM tmpMHPP " 
strsql = strsql & "WHERE Declination Is Not Null" 
strsql = strsql & "or Leave Is Not Null Or Termed Is Not Null Or Comments Is Not Null" 
+3

你在第三线('WHERE赤纬IS NOT NULL结束缺少空格之间'),所以这些字符串被连接为'... NULLOR ...'。 – stakx 2014-10-29 18:42:32

回答

0

你错过了

... Declination Is Not Null 

or Leave Is Not Null ... 
2

你缺少空间之间的空间。您需要添加一个空格不是null或

strsql = strsql & "WHERE Declination Is Not Null " 
               '^' 
strsql = strsql & "or Leave Is Not Null Or Termed Is Not Null Or Comments Is Not Null" 
0

这句法帮助避免这些错误

strsql = "SELECT [Employee Number], Declination, Leave, Termed, Comments" & _ 
     " FROM tmpMHPP" & _ 
     " WHERE Declination Is Not Null" & _ 
     " or Leave Is Not Null Or Termed Is Not Null Or Comments Is Not Null" 
+0

你不是在说错误是什么。 ;)这就是说,我也做了很多相同的事情,但我习惯于在每行的末尾加上空格*和*。 – stakx 2014-10-29 18:48:27

+0

它是一个简单的错字,所以我提到这是一个附录,并投票结束为简单错字 – 2014-10-29 18:50:23