如何写记录查询明智的2周?

时间:2019-07-10 12:10:08

标签: sqlite

以下我为每周获取记录写的查询。

Dim objOutlook, myMail, Arg
Const ExpectArgCount = 14
Set objOutlook = CreateObject("Outlook.Application")
'Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set myMail = objOutlook.CreateItem(0)
Set Arg = WScript.Arguments

If Arg.Count = ExpectArgCount Then
  myMail.Attachments.Add Arg(0)
  IMED = Arg(1)
  URL = Arg(2)
  dashLoad = Arg(3)
  roles = Arg(4)
  consent = Arg(5)
  dash = Arg(6)
  servMenu = Arg(7)
  folowUp = Arg(8)
  servReq = Arg(9)
  SRN = Arg(10)
  PoP = Arg(11)
  Doc = Arg(12)
  SalesDashLoad = Arg(13)
  MsgBox (SalesDashLoad)
Else
  Call Err.Raise(vbObjectError + 1, "My Application", "Incorrect number of arguments passed")
End If

但是我面临2周取回记录写查询的问题。 请帮帮我!

1 个答案:

答案 0 :(得分:1)

您可以尝试将一周除以2:-

Select a.VPA, STRFTIME('%W',b.ActualDateTime) / 2 as Week, sum(b.Amount) as Amount 
from STransDetails as b
Join SAccount as a On a.TransactionId = b.TransactionIdT 
WHERE a.VPA = 'vpa@HDL'
Group by Week