I have another question...is there a way to add to the sql query in Crystal? When I right click the DataBase Field, I can get to Show Query, but can't edit it...
Crystal puts in the single quote at the front and back..I took out my single quotes, but still get the same error msg...I'll deal with it tomaro...thanks for all the input Luna...
hey Lun, I decided to create a Dataset and use that to get the query I need for the report...I'm using the code below, and I'm not getting any errors, but the output on the report is the same as before, it's giving me all the data in the DB. I think it's using the query I created when I made my report...do you know how Ic an kill that query so it only uses the Dataset to fill the report?
VB Code:
Dim cmdView As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("select purchase_date,credit_card_no,vendor_name,transaction_amt,sales_tax_amt,status_ind from pcms.pcms_pcard_transaction_header where purchase_date between TO_DATE('" & tranPeriod & "','mm/dd/yyyy') and TO_DATE('" & tranPeriodEnd & "','mm/dd/yyyy') ", objCon)
ds = New DataSet()
cmdView.Fill(ds, "cards")
Dim oRpt As New CrystalReport1() ' create new report object
1- Give the solution i gave you a try. It should work.
2- If you decide to base your report on dataset instead of Database, you should add the dataset at desing time to your project. Then at desing time you should use the dataset file,lets say its mydataset.XSD, as the datasourse of your report and drag the fields from there to your report.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
with your solution I wasn't getting the value from a table, it was coming from my app. I wanted to place the transaction period on the top of my report, so I was grabbing that value from a combobox on my form and then calling it by the formula name on the top of the report.
In your selection formula you should provide both the table name and filed name. So if the table in your database is called mytable then you should use {mytablename.begindate}=yourdesiredvalue
in your formula. It's quite clear.
Last edited by Lunatic3; May 27th, 2003 at 12:48 PM.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979