pass parameter to an extraction
Forums
How can I pass parameters or arguments to an extraction of this type.
the part in bold are the months of a date entered in the form
Sub Main
Call DirectExtraction()'FISA.TPLA_HISDAT.IMD
End Sub
' Datos: Extracción directa
Function DirectExtraction
Set db = Client.OpenDatabase("FISA.TPLA_HISDAT.IMD")
Set task = db.Extraction
task.IncludeAllFields
dbName = "xxxxxxxx.IMD"
task.AddExtraction dbName, "", " HIS_MES_FECHA_FECHA_ >= ""02 "" .AND. HIS_MES_FECHA_FECHA_ <=""03 "" "
task.PerformTask 1, db.Count
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
Thank you,
Thank you,
but I have a problem when passing the parameters, because I am passing 4, two dates, and the two months of both dates and they are fine, but when arriving at the extraction there is a compile error that does not detail well. I'll send an example to see if you can illustrate me. maybe the argument is wrong? or something is missing, because in the import odbc if it works with the date.
Sub Main
MsgBox " date..... 1..." & arg1
MsgBox " date ...... 2..." & arg2
MsgBox "month 1...." & arg3
MsgBox " month 2...... " & arg4
Call DirectExtraction()'FISA.TPLA_ACCRUAL.IMD
End Sub
' Datos: Extracción directa
Function DirectExtraction
Set db = Client.OpenDatabase("FISA.TPLA_ACCRUAL.IMD")
Set task = db.Extraction
task.IncludeAllFields
dbName = "prueba.IMD"
task.AddExtraction dbName, "", " ACC_MES_FECHA_FECHA >= ""& arg3 &"" .AND. ACC_MES_FECHA_FECHA <= ""& arg4 &"""
task.PerformTask 1, db.Count
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
You can do this in two ways.
You can do this in two ways.
or the second way doesn't screw up the colouring in the editor.