Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB SQL Check if Numeric

Posted on 2014-10-23
1
Medium Priority
?
234 Views
Last Modified: 2014-10-23
Hi Experts

I have a table on SQLServer key of nvarchar(10) and Description
I has Numeric and String in the key
I need to select from another table with a key if INT so I want to check and block any string keys

TableA id nVarchar(10) Key, Description nVarchar(50)
TableB id Int, Amount, Type
 
Select
a.Description
, b. Amount
, b.Type
From TableA a
Left Join
TableB b on (b.id = a.id)

Errors - Error Conversion error when converting the nvarchar value 'The value' to data type int

Thanks
0
Comment
Question by:Kevinfeening
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 2000 total points
ID: 40400487
Try like this :

Select 
a.Description
, b. Amount
, b.Type
From TableA a 
Left Join 
TableB b on (b.id = cast( a.id as int))

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question