以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关于and和andalso  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=64841)

--  作者:sky-18
--  发布时间:2015/3/3 13:42:00
--  关于and和andalso
If DataTables("开单").Find("[开单日期]=#" & rq & "#andalso [厂]=\'" & cg & "\'") Is Nothing Then
不知道上面的代码到底哪里错了,,运行的时候提示:语法错误:“andalso”运算符后缺少操作数。
 不知道为什么
于是我又把andalso改成and,运行就正常了。
andalso和and不是一样吗,,这是为什么呢?

--  作者:lsy
--  发布时间:2015/3/3 13:50:00
--  
And 是SQL代码,AndAlso是狐表代码。

搞不清的,都用And

--  作者:sky-18
--  发布时间:2015/3/3 13:54:00
--  
好奇怪,,
不是每次andalso都会报错。有时候会有时候不会。
难道要把以前用过的andalso都改过来吗?不然心里有点不踏实啊。
以后都不要用andalso了吗?

--  作者:有点甜
--  发布时间:2015/3/3 14:04:00
--  

 编写查询语句的时候,只能用 And

 

 在编写比如 If 语句的时候,才用 AndAlso

 

 或者你全部用 and 也可以