S
siagian
Set db = CurrentDb
Set qdfReport = db.CreateQueryDef("", _
"PARAMETERS tgl_awal DateTime, tgl_akhir
DateTime; " & _
"SELECT [tblWO].[no_wo], [tblWO].[masuk_tgl],
[tblDataKendaraan].[no_pol], [tblDataPemilik].
[perusahaan], [tblWO].[no_wo] AS wo " & _
"FROM tblDataPemilik RIGHT JOIN (tblDataKendaraan
RIGHT JOIN tblWO ON [tblDataKendaraan].[nokey_cu]=[tblWO].
[nokey_cu]) ON [tblDataPemilik].[IDCU]=[tblDataKendaraan].
[IDCU]" & _
" WHERE ((([tblWO].[masuk_tgl]) Between [tgl_awal]
And [tgl_akhir])) " _
& " ORDER BY [tblWO].[masuk_tgl], [tblWO].[no_wo]")
qdfReport.Parameters!tgl_awal = Me.awal
qdfReport.Parameters!tgl_akhir = Me.akhir
With qdfReport
' Open Recordset from QueryDef.
Set rs = .OpenRecordset(dbOpenSnapshot)
With rs
Set Me.Recordset = rs
End With
End With
Data 30000 record each table
why at first time slow ??
thanks
Set qdfReport = db.CreateQueryDef("", _
"PARAMETERS tgl_awal DateTime, tgl_akhir
DateTime; " & _
"SELECT [tblWO].[no_wo], [tblWO].[masuk_tgl],
[tblDataKendaraan].[no_pol], [tblDataPemilik].
[perusahaan], [tblWO].[no_wo] AS wo " & _
"FROM tblDataPemilik RIGHT JOIN (tblDataKendaraan
RIGHT JOIN tblWO ON [tblDataKendaraan].[nokey_cu]=[tblWO].
[nokey_cu]) ON [tblDataPemilik].[IDCU]=[tblDataKendaraan].
[IDCU]" & _
" WHERE ((([tblWO].[masuk_tgl]) Between [tgl_awal]
And [tgl_akhir])) " _
& " ORDER BY [tblWO].[masuk_tgl], [tblWO].[no_wo]")
qdfReport.Parameters!tgl_awal = Me.awal
qdfReport.Parameters!tgl_akhir = Me.akhir
With qdfReport
' Open Recordset from QueryDef.
Set rs = .OpenRecordset(dbOpenSnapshot)
With rs
Set Me.Recordset = rs
End With
End With
Data 30000 record each table
why at first time slow ??
thanks