CurtTampa
Jun 22nd, 2006, 03:43 PM
Here is the code I am running. I am attempting to specify a 2nd and 3rd order by with no luck.
Dim selectionFormula As String = "{Invoice_Header.SRF-CustomerNumber} = " & Session("SRF-CustNo")
selectionFormula = selectionFormula & " AND {Invoice_Header.Invoice Date} >= #" & Format(CDate(Session("SDT")), "MM/dd/yyyy") & " 00:00:01#"
selectionFormula = selectionFormula & " AND {Invoice_Header.Invoice Date} <= #" & Format(CDate(Session("EDT")), "MM/dd/yyyy") & " 23:59:59#"
If Session("TechNo") <> "" Then
selectionFormula = selectionFormula & " AND {Invoice_Header.Tech Number} = '" & Session("TechNo") & "'"
End If
selectionFormula = selectionFormula & " Order by {Invoice_Header.Tech Number} "
'
' PROBLEM IS IN THE next 2 Lines
'
selectionFormula = selectionFormula & " by {Invoice_Header.Invoice Number} "
selectionFormula = selectionFormula & " by {Invoice_Header.Invoice Line Number} "
InvoiceRegister.DataDefinition.RecordSelectionFormula = selectionFormula
CrystalReportViewer1.ReportSource = InvoiceRegister
Dim selectionFormula As String = "{Invoice_Header.SRF-CustomerNumber} = " & Session("SRF-CustNo")
selectionFormula = selectionFormula & " AND {Invoice_Header.Invoice Date} >= #" & Format(CDate(Session("SDT")), "MM/dd/yyyy") & " 00:00:01#"
selectionFormula = selectionFormula & " AND {Invoice_Header.Invoice Date} <= #" & Format(CDate(Session("EDT")), "MM/dd/yyyy") & " 23:59:59#"
If Session("TechNo") <> "" Then
selectionFormula = selectionFormula & " AND {Invoice_Header.Tech Number} = '" & Session("TechNo") & "'"
End If
selectionFormula = selectionFormula & " Order by {Invoice_Header.Tech Number} "
'
' PROBLEM IS IN THE next 2 Lines
'
selectionFormula = selectionFormula & " by {Invoice_Header.Invoice Number} "
selectionFormula = selectionFormula & " by {Invoice_Header.Invoice Line Number} "
InvoiceRegister.DataDefinition.RecordSelectionFormula = selectionFormula
CrystalReportViewer1.ReportSource = InvoiceRegister