以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  求助有关Excel的问题!!!  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=43327)

--  作者:myzzip
--  发布时间:2013/12/4 14:33:00
--  求助有关Excel的问题!!!

Sheet(1,2).Value = "[$销售明细,Sum(数量),产品名称 =\'A气\'And 会员卡 <> 0 And 销售日期 = #" & Date.Today & "#]"

Sheet(2,2).Value = "[$销售明细,Sum(数量),产品名称 =\'A气\'And 会员卡 = 0 And 销售日期 = #" & Date.Today & "#]"

 

Sheet(7,2).Value =  Sheet(2,2).Value + Sheet(1,2).Value  可以这样写吗?

 

 


--  作者:狐狸爸爸
--  发布时间:2013/12/4 14:38:00
--  

不可以。

 

你为啥不直接用FoxTable计算:

 

Dim s1 As double =DataTables("销售明细").Compute("Sum(数量)", "产品名称 =\'A气\' And 会员卡 <> 0 And 销售日期 = #" & Date.Today & "#")

Dim s2 As double = DataTables("销售明细").Compute("Sum(数量)", "产品名称 =\'A气\' And 会员卡 = 0 And 销售日期 = #" & Date.Today & "#")

Sheet(1,2).Value = s1
Sheet(2,2).Value = s2

Sheet(7,2).Value = s1 + s2

[此贴子已经被作者于2013-12-4 14:39:30编辑过]