Brief Explanation of problem:
I'm currently trying to create a report (RDL file) in visual studio that gets all the phone calls for a specific case, and prints them out in 2 tables that look like this: Current tables . My issue is that when I run the report, it is grabbing information from every case, instead of the particular case I'm currently in.
Here is the query I'm using to get the information for the tables:
SELECT
FilteredPhoneCall.regardingobjectidname,
FilteredPhoneCall.icms_contactname,
FilteredPhoneCall.owneridname,
FilteredPhoneCall.icms_callendtime,
FilteredPhoneCall.icms_informationgathered,
Filteredicms_impcase.icms_casenumber
FROM
FilteredPhoneCall,
Filteredicms_impcase
WHERE FilteredPhoneCall.regardingobjectidname
LIKE '%' + Filteredicms_impcase.icms_casenumber + '%'
How should I change my query so that it specifies that all information should be from a single case. Here are some pictures of the 2 tables I'm trying to join for clarity:
FilteredPhoneCall table and Filteredicms_impcase
Should I be using an inner join statement? Also let me clarify my thought process on why I'm using the LIKE statement is because of how the rows are in the system, the FilteredPhoneCall.regardingobjectidname
is formatted like this: Name of company / CaseID, I need the 2nd half of that value, the CaseID in order to join the tables together to get the specific case value.
A)whether my syntax is working the way how I think it's working?
B)should I use a more specific identifier, like an INNER JOIN?