UnsolvedCoding
Technical User
Ok, while working on the solution to the last post I came across another one that I know should be simple but I can't find the answer.
Here are the two queries.
Select R.Report_Number
, S.System_Report_Number
From Report as R
Inner Join Report_Table as S
On Cast(Cast(R.Report_Number as Int) as Varchar (20) = s.System_Report_Number
Select R.Report_Number
, S.System_Report_Number_Replacment
From Report as R
Inner Join Archived_Report_Table as S
On Cast(Cast(R.Report_Number as Int) as Varchar (20) = s.System_Report_Number_Replacment
I am taking the info from the report, scrubbing it against the first table and if here is no system report then scrubbing it against the archives.
How can I make this one query?
Here are the two queries.
Select R.Report_Number
, S.System_Report_Number
From Report as R
Inner Join Report_Table as S
On Cast(Cast(R.Report_Number as Int) as Varchar (20) = s.System_Report_Number
Select R.Report_Number
, S.System_Report_Number_Replacment
From Report as R
Inner Join Archived_Report_Table as S
On Cast(Cast(R.Report_Number as Int) as Varchar (20) = s.System_Report_Number_Replacment
I am taking the info from the report, scrubbing it against the first table and if here is no system report then scrubbing it against the archives.
How can I make this one query?