Click to See Complete Forum and Search --> : RecordSelectionFormula


calvinkwoo3000
August 20th, 2007, 03:22 AM
hi , i am newbie in crstal report,
I had face a problem when i try to set the formula for selection.

I hope to query record that inv_date and c_date bigger than certain date.
so i set the formula like below:

r.RecordSelectionFormula =
"{ViewReportTraking.inv_date} >= DateValue('" & datefrom.ToString() & "') or {ViewReportTraking.c_date} >= DateValue('" & datefrom.ToString() & "')"

What happen is the query only select the record inv_date >= certainDate,
but not the c_date >=certainDate.


when i try to set it to opposite
r.RecordSelectionFormula =
"{ViewReportTraking.c_date} >= DateValue('" & datefrom.ToString() & "') or {ViewReportTraking.inv_date} >= DateValue('" & datefrom.ToString() & "')"

I need query either inv_date or c_date >= certainDate.

gjack72
August 20th, 2007, 06:15 PM
Are you wanting to retrieve records back where both the inv_Date and c_date are >= your "certain date"? If so change your "or" to "and", then you will get back records where both conditions are true.

GJ

calvinkwoo3000
August 20th, 2007, 10:28 PM
No, i need either inv_date > certainDate or c_date > certainDate is true then query record.
but the 'or' look like not function, but the 'and' is function.