Hi ng
I open the following recordset in a module - and the performance is
very
slow - anyone who has an idea to speed it up. (The table is indexed)
Here
is the code:
strDatestart = Format([Forms]![frm_reklamation er]![txtStartInterva l],
"mm/dd/yy")
strDatestop = Format([Forms]![frm_reklamation er]![txtStopInterval],
"mm/dd/yy")
strPeriodeAS = "Format(DateAdd ('d', -1, [Dato]), 'ww') as Week_No"
strPeriode = "Format(DateAdd ('d', -1, [Dato]), 'ww')"
strSQL = "SELECT " & strPeriodeAS & ", Sum(Tbl_Product ion.figures) AS
SumOffigures " _
& "FROM Tbl_Production WHERE Dato >= #" & strDatestart & "# And
Dato
<= #" & strDatestop & "# " _
& "GROUP BY Year([Dato]), " & strPeriode _
& "ORDER BY Year([Dato]), " & strPeriode
Set rst1 = db.OpenRecordse t(strSQL)
Thanks in advance
Jens
I open the following recordset in a module - and the performance is
very
slow - anyone who has an idea to speed it up. (The table is indexed)
Here
is the code:
strDatestart = Format([Forms]![frm_reklamation er]![txtStartInterva l],
"mm/dd/yy")
strDatestop = Format([Forms]![frm_reklamation er]![txtStopInterval],
"mm/dd/yy")
strPeriodeAS = "Format(DateAdd ('d', -1, [Dato]), 'ww') as Week_No"
strPeriode = "Format(DateAdd ('d', -1, [Dato]), 'ww')"
strSQL = "SELECT " & strPeriodeAS & ", Sum(Tbl_Product ion.figures) AS
SumOffigures " _
& "FROM Tbl_Production WHERE Dato >= #" & strDatestart & "# And
Dato
<= #" & strDatestop & "# " _
& "GROUP BY Year([Dato]), " & strPeriode _
& "ORDER BY Year([Dato]), " & strPeriode
Set rst1 = db.OpenRecordse t(strSQL)
Thanks in advance
Jens
Comment