fwstealer
asked on
find matches between two tables
need to find all rows from drive where the driveid is in the expensereport table
select drives.driveid as 'Apple.drives.driveID', ExpenseReport.driveID as 'Po.ExpenseReport.driveID'
from ExpenseReport with(nolock)
inner join aserver.apple.dbo.drives drive with(nolock) on ExpenseReport.driveID = drive.driveid
where drive.driveid = ExpenseReport.driveID
my error: Error on the 1st line: Conversion failed when converting the varchar value 'No send me to confirmation page now' to data type int.
select drives.driveid as 'Apple.drives.driveID', ExpenseReport.driveID as 'Po.ExpenseReport.driveID'
from ExpenseReport with(nolock)
inner join aserver.apple.dbo.drives drive with(nolock) on ExpenseReport.driveID = drive.driveid
where drive.driveid = ExpenseReport.driveID
my error: Error on the 1st line: Conversion failed when converting the varchar value 'No send me to confirmation page now' to data type int.
Wouldn't that still give you the same error??
<< Conversion failed when converting the varchar value 'No send me to confirmation page now' to data type int>>
I don't see a column 'No send me to confirmation page now' in your query. So I think there is a view involved that isn't correct.
I don't see a column 'No send me to confirmation page now' in your query. So I think there is a view involved that isn't correct.
This is because the data type of DriveID do not match between Drive table and ExpenseReport table.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window