open up excel, select say sheet 2 goto tools then select macro then record new macro then save macro, then goto data get external data new database query then browse for the db you have in RSV, select the fields required,press next, then you can sort the data(choose just a few by datetime >= to and <= to sort by xxx then return data to excel then stop recording the macro.
goto tools select visualbasic, select module 1 this will contain the code as recorded, you can copy the code into a form like a popup then change the date/time fields with variables (note: keep the format correct) the variables to change are in red you will need to create a window in excel that contains say a date picker be careful when adding variables & the kind of data in the variable it has to be exact format for the query to work
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 25/03/2010 by len
'
'
Application.WindowState = xlMinimized
Application.WindowState = xlNormal
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=myScada;UID=BCHRMS;Trusted_Connection=Yes;APP=Microsoft® Query;WSID=LEN_HOME;DATABASE=myScada;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT FIXALARMS.ALM_TAGNAME, FIXALARMS.ALM_VALUE, FIXALARMS.ALM_DESCR, FIXALARMS.ALM_ALMAREA, FIXALARMS.ALM_DATELAST, FIXALARMS.ALM_TIMELAST, FIXALARMS.ALM_DTLAST" & Chr(13) & "" & Chr(10) & "FROM BCHScada.dbo.FIXALARMS FIXALAR" _
, _
"MS" & Chr(13) & "" & Chr(10) & "WHERE (FIXALARMS.ALM_DATELAST>='26/06/06' And FIXALARMS.ALM_DATELAST<='26/12/06')" & Chr(13) & "" & Chr(10) & "ORDER BY FIXALARMS.ALM_TAGNAME" _
)
.Name = "Query from myScada"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
End Sub