Sub OnClick(Byval Item)
Dim MSFGridFree,listFree,TimeInterval,comboxS,DaySelectSTA,HourST,HourED,DaySelectEDA,optasc,SelHourA
Dim STARTime,ENDtime'开始时间和结束时间变量
Set MSFGridFree = ScreenItems("MSFGridHour")
Set listFree=ScreenItems("ListParaF")
Set TimeInterval = ScreenItems("SelHourF")
Set comboxS = ScreenItems("DataTypeHour")
Set DaySelectSTA = ScreenItems("DaySelectSF")
Set HourST = ScreenItems("StartHourF")
Set DaySelectEDA = ScreenItems("DaySelectEF")
Set HourED = ScreenItems("EndHourF")
Set optasc = ScreenItems("AscOPThour")
On Error Resume Next
MSFGridFree.Clear
Select Case Trim(comboxS.text)
Case "平均值"
FieldName = "PAVG"
Case "最大值"
FieldName = "PMAX"
Case "最小值"
FieldName = "PMIN"
Case "采样值"
FieldName = "PSAM"
End Select
STARTime = DaySelectSTA.Value & " " & HourST.Text & ":00:00"'查询的开始时间
ENDtime = DaySelectEDA.Value & " " & HourED.Text & ":00:00"'查询的结束时间
If DateDiff("h",Now,ENDtime) > 0 Then
MsgBox "结束时间不能大于当前时间!",65,"提示"
Exit Sub
End If
If DateDiff("h",STARTime,ENDtime) <= 0 Then
MsgBox "结束时间不能小于开始时间!",65,"提示"
Exit Sub
End If
'STARTime = DateAdd("d",-1,STARTime)
'ENDtime = DateAdd("h",-1,ENDtime)'查询的结束时间减去一小时
'STARTime = Year(STARTime) & "-" & Month(STARTime) & "-" & Day(STARTime) & " " & Hour(STARTime) & ":" & Minute(STARTime) & ":" & Second(STARTime)
'ENDtime = Year(ENDtime) & "-" & Month(ENDtime) & "-" & Day(ENDtime) & " " & Hour(ENDtime) & ":" & Minute(ENDtime) & ":" & Second(ENDtime)
hmiruntime.Trace DateDiff("h",STARTime,ENDtime) & "y与开始"
HMIRuntime.Trace DateDiff("h",Now,ENDtime) & "y与现在"
HMIRuntime.Trace STARTime & vbCrLf & ENDtime & vbCrLf
这个是原来报表的语句,我现在想改成只显示一个电量的累计值,而在查询区间内每小时显示电量的差值,最后应如何修改呢?并且将差值显示在柱状图中,请各位大神帮忙看看