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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query

Status
Not open for further replies.

Mygurutech

IS-IT--Management
Mar 24, 2008
10
NL
hi,
i'm building an application with sql server iso Access
now when converting the access query into sql server
retrieving an error

SELECT Left([CallID],3) AS CallType, Val(Right([CallID],Len([CallID])-3)) AS [Number]
FROM Call
WHERE (((IsNumeric(Right([CallID],5)))=True));

VAL should be Convert..
but get now the error on RIGHT..
please advice what to do

kisoen
 
Check CAST and CONVERT functions in BOL:
Code:
SELECT Left([CallID],3) AS CallType, 
       CAST(Right([CallID],Len([CallID])-3) as integer) AS [Number]
FROM Call
WHERE IsNumeric(Right([CallID],Len([CallID])-3))=1

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top