http://www.foxtable.com/help/topics/1285.htm
试试这样
月:
Dim cnt1 As Integer = DataTables("销售订单主表").Compute("Sum(销售金额)","SubString(Convert([销售日期],'System.String'),6,IIF(SubString(Convert([销售日期],'System.String'),7,1) In ('-','/'),1,2)) = '" & Date.Today.Month & "'")
年:
Dim cnt1 As Integer = DataTables("销售订单主表").Compute("Sum(销售金额)","SubString(Convert([销售日期],'System.String'),1,4)= '" & Date.Today.Year & "'")