Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equate number to varchar

Status
Not open for further replies.

manmaria

Technical User
Aug 8, 2003
286
US
How do I equate 2 columns from 2 different tables. In one table the same column is defined as dec(9,0) and the other table it is defined as varchar(15)?

Thanks
 
You need to cast the decimal a varchar:
Cast(NumericField as VARCHAR(15))
 
Or the varchar to a decimal, it depends...

If you simply write "WHERE DecCol = CharCol" the optimizer just casts the Varchar to a float.

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top