Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
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)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...