Professional Documents
Culture Documents
5 P
5 P
Dim tg
timeBegin = Sheet8.Range("D8").Value
timeEnd = Sheet8.Range("D9").Value
StrBegin = "'" & Month(timeBegin) & "/" & Day(timeBegin) & "/" & Year(timeBegin) & " " &
Hour(timeBegin) & ":" & Minute(timeBegin) & "'"
StrEnd = "'" & Month(timeEnd) & "/" & Day(timeEnd) & "/" & Year(timeEnd) & " " & Hour(timeEnd) &
":" & Minute(timeEnd) & "'"
strSQL = strSQL & " FROM [DB].[dbo].[MEAS_WSS1] WHERE (E3TimeStamp BETWEEN " & StrBegin & "
AND " & StrEnd & ") ORDER BY E3TimeStamp"
With tgRS
.ActiveConnection = "Provider=SQLOLEDB;User ID=" & User & "; PWD=" & Pass & ";Initial Catalog="
& Cat & ";Data Source=" & Ser & ";"
.Source = strSQL
.Open
End With
iRow = 13
Sheet8.Range("A1").Value = tgRS.Fields(0).Value
en_Print = True
If en_Print Then
End If
iRow = iRow + 1
tgRS.MoveNext
Wend
With tgRS
.Close
End With