Database Question

  • Thread starter Thread starter Laura
  • Start date Start date
L

Laura

In a database, if you have SQL to do a join and you're
pulling a column in one talbe (VARCHAR) that is 4
characters wide; and trying to compare it to a number that
is 5 characters wide (using function DIGITS to make the
number into characters0, how do I make both numbers 5 wide
so I can compare them?

For example, if in VARCHAR is have 0199, it pulls over
0199; but when I convert the number to a character, 0199
pulls in as 00199...

Thoughts?
 
You're not comparing numbers - you're comparing numbers formatted as text.

Why not convert the varchar to number and compare them?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top