Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Int not a function name

Author  Topic 

mrgalvan
Starting Member

9 Posts

Posted - 2006-08-02 : 12:24:30
I'm trying to create a view, but recieved this error. I'm running throught, just a select statment before I create view.
'Int' not a function name... WHY NOT!

Here is my statement:


SELECT I.ItemID, D.ShortDesc, I.CompanyID, BI.QtyOnHand, WB.WhseBinID, W.WhseID
FROM timItem I
INNER JOIN timitemdescription D (nolock) ON I.ItemKey = D.ItemKey
INNER JOIN timWhseBinInvt BI (nolock) ON I.ItemKey = BI.ItemKey
INNER JOIN timWhsebin WB (nolock) ON BI.WhseBinKey = WB.WhseBinKey
INNER JOIN timWarehouse W (nolock) ON WB.WhseKey = W.WhseKey
--INNER JOIN tsoSOLineDist SL ON W.WhseKey = SL.WhseKey
--INNER JOIN tsoSOLine SOL ON I.ItemKey = SOL.ItemKey
AND BI.ItemKey = I.ItemKey
WHERE BI.QtyOnHand > '0' and I.ItemId = '22858' and Int(Left(WhseBinID,2))
GROUP BY I.ItemID, D.ShortDesc, I.CompanyID, WB.WhseBinID, W.WhseID, BI.QtyOnHand

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-08-02 : 12:30:21
because it wants you to use CONVERT, this being T-SQL

For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx

Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-08-02 : 12:35:03
quote:
Originally posted by mrgalvan
Int(Left(WhseBinID,2))



What is that anyway? How does that evaluate to TRUE or FALSE anyway?

What are you comparing?

anyway

CONVERT(int,Left(WhseBinID,2))=?
AND ISNUMERIC(Left(WhseBinID,2))=0

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

mrgalvan
Starting Member

9 Posts

Posted - 2006-08-02 : 13:02:03
There are bin locations that are numeric and bin locations that are name, ie group bin or 97-108-32. I just want to get the bin locations that are numeric.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-08-04 : 03:58:52
Maybe something like this?
SELECT DISTINCT	I.ItemID,
D.ShortDesc,
I.CompanyID,
BI.QtyOnHand,
WB.WhseBinID,
W.WhseID
FROM timItem I
INNER JOIN timitemdescription D (NOLOCK) ON D.ItemKey = I.ItemKey
INNER JOIN timWhseBinInvt BI (NOLOCK) ON BI.ItemKey = I.ItemKey
INNER JOIN timWhsebin WB (NOLOCK) ON WB.WhseBinKey = BI.WhseBinKey
INNER JOIN timWarehouse W (NOLOCK) ON W.WhseKey = WB.WhseKey
WHERE BI.QtyOnHand > '0'
AND I.ItemId = '22858'
AND LEFT(WB.WhseBinID, 2) LIKE '[0-9][0-9]'

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-04 : 09:14:06
or

WB.WhseBinID LIKE '[0-9][0-9]%'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -