Link to home
Start Free TrialLog in
Avatar of Jintonix415
Jintonix415

asked on

Formatting values in two columns from one table to equal the values in one column using SQL VB

Table1
I have Column1 with values like 708-408
I have Column2 with values like 600

Table2
I have Column3 with values 708-408-600

I have a VB script logic that joins Table1 columns that equals Table2 Column3.

CAST([Column1] AS VARCHAR) + replace(str(CAST([Table1].[Column2] AS VARCHAR), 11),'',0) = [Table2].[Column3]

I want to know if the format in the first part CAST([Column1] AS VARCHAR) + replace(str(CAST([Table1].[Column2] AS VARCHAR), 11),'',0)  is the correct format so that it should exactly be in this format ###-###-###.






ASKER CERTIFIED SOLUTION
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jintonix415
Jintonix415

ASKER

It worked!!! Thanks!!!