Hi there,
I am using Crystal 10. I figured out WHY my record selection criteria is not working, but not sure how to fix. I know the "OR" statements I have in here are causing the statement to evaluation everything up to the "OR" statement and if it's able to return data, is ignoring everything AFTER the "OR" statement.
Can anyone suggest how I might structure the record selection criteria so ALL the statements are evaluated.
I am trying to pull records where there is a vendor number and if there is also address information, pick that up. Then if there is vendor_category_notes, pick that up as well and if there is system_user information, pick that up too. The criteria (as I've structured it below) works in SQL Query Analyzer, but I now realize that Crystal evaluates criteria differently than SQL. So where SQL will pick up the "OR" statements just fine, Crystal does not and that's where I am stuck now.
I've tried moving my parenthesis around, removing them, enclosing the individual pieces, enclosing the entire statement (in hopes it would evaluate the whole selection criteria as one statement), but that didn't work. Any suggestions are greatly appreciated. Thank you so much!
(({AUDIT_TRAIL_VENDOR.VENDOR_NBR} = {?vendorNbr}) OR
({AUDIT_TRAIL_VENDOR.ADDR_ID} = {ADDRESS.ADDR_ID})
AND ({AUDIT_TRAIL_VENDOR.TABLE_NAME} = "ADDRESS") OR
({AUDIT_TRAIL_VENDOR.TABLE_NAME} = "VENDOR_CATEGORY_NOTES") AND ({AUDIT_TRAIL_VENDOR.NOTE_ID} = {VENDOR_CATEGORY_NOTES.NOTE_ID}) OR
({AUDIT_TRAIL_VENDOR.TABLE_NAME} = 'SYSTEM_USERS')
AND ({AUDIT_TRAIL_VENDOR.SYSTEM_USER_ID} = {SYSTEM_USERS.SYSTEM_USER_ID}))
I am using Crystal 10. I figured out WHY my record selection criteria is not working, but not sure how to fix. I know the "OR" statements I have in here are causing the statement to evaluation everything up to the "OR" statement and if it's able to return data, is ignoring everything AFTER the "OR" statement.
Can anyone suggest how I might structure the record selection criteria so ALL the statements are evaluated.
I am trying to pull records where there is a vendor number and if there is also address information, pick that up. Then if there is vendor_category_notes, pick that up as well and if there is system_user information, pick that up too. The criteria (as I've structured it below) works in SQL Query Analyzer, but I now realize that Crystal evaluates criteria differently than SQL. So where SQL will pick up the "OR" statements just fine, Crystal does not and that's where I am stuck now.
I've tried moving my parenthesis around, removing them, enclosing the individual pieces, enclosing the entire statement (in hopes it would evaluate the whole selection criteria as one statement), but that didn't work. Any suggestions are greatly appreciated. Thank you so much!
(({AUDIT_TRAIL_VENDOR.VENDOR_NBR} = {?vendorNbr}) OR
({AUDIT_TRAIL_VENDOR.ADDR_ID} = {ADDRESS.ADDR_ID})
AND ({AUDIT_TRAIL_VENDOR.TABLE_NAME} = "ADDRESS") OR
({AUDIT_TRAIL_VENDOR.TABLE_NAME} = "VENDOR_CATEGORY_NOTES") AND ({AUDIT_TRAIL_VENDOR.NOTE_ID} = {VENDOR_CATEGORY_NOTES.NOTE_ID}) OR
({AUDIT_TRAIL_VENDOR.TABLE_NAME} = 'SYSTEM_USERS')
AND ({AUDIT_TRAIL_VENDOR.SYSTEM_USER_ID} = {SYSTEM_USERS.SYSTEM_USER_ID}))