Re: Passing Date Parameters
With Oracle, you have to use the TO_DATE function in your SQL command :
SELECT a.field, b.field2 FROM table a,table b
WHERE a.id = b.id AND
a.date >= TO_DATE(" & text1.value & ") AND a.date <= TO_DATE(" & text2.value & ")"
Marc
Re: Passing Date Parameters
If you are using the data value as literal (string) then you can try putting # before & after
This sql works for Jet DBs (may be for others also!)
sqlstr = "SELECT a.field, b.field2 FROM table a,table b WHERE a.id = b.id AND
a.date >= #" text1.value & "# AND a.date <= #" & text2.value &"#"
Re: Passing Date Parameters
Hi, I've managed to solve the mystery. Since the date field in Oracle is Date/Time I need to format my VB variable to Date/Time not just Date, For example CRWConnect = "DSN = Restrac1; UID = crystal;PWD = diamond;DSQ= HIRE"
Me.MousePointer = vbHourglass
CRW7.ReportFileName = "D:\RESTRAC\CRW Reports\New Summary Requisition Activity.Rpt"
CRW7.Connect = CRWConnect
RecSelect1 = "{REQUISITION.Reqcode} = '" & frmReqActivity.cboRequisition.Text & "' "
CRW7.SelectionFormula = RecSelect1 + "AND" + "{REQUISITION.EnteredDate} in DateTime(" & Me.txtBDate.Text & ",00, 00, 00)" _
& " to DateTime(" & Me.txtEDate.Text & ",00, 00, 00)" Which yield the correct results. Thanks again for everyone's help