Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in SQL by (6.1k points)

I am having the following code that results with error:

SELECT 
    A.SETMOD, B.DESCRP 
FROM 
    PMS.PSBSTTBL A 
JOIN 
    PMS.PR029TBL B ON A.SETMOD = B.PAYMOD

Paymod is of datatype VARCHAR, SETMOD of datatype decimal.

1 Answer

0 votes
by (12.7k points)

The best way is to convert the decimal to string and compare it with the string value. You can do needed adjustments on the decimal part.

SELECT 
    A.SETMOD, B.DESCRP 
FROM 
    PMS.PSBSTTBL A 
JOIN 
    PMS.PR029TBL B ON CONVERT(VARCHAR(50),A.SETMOD) = B.PAYMOD

 Want to know more about SQL? Join this SQL Course by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Jul 22, 2019 in SQL by Tech4ever (20.3k points)

Browse Categories

...