General information
Forum:
Microsoft SQL Server
Title:
Select into function
Environment versions
SQL Server:
SQL Server 2000
I'm trying to select a bunch of information including lineno, and I want to pass lienno into a function but its keeps giving me an incorrect syntax error. Basically,
select [lineno],(select item from tax([lineno])) from table
cant seem to get this to work, I think my syntac might be off.
CREATE PROCEDURE sp_invoicedetail
@sono as char(10)
AS
select [lineno],s.item,descrip,qtyord,qtyshp,cost,
(((s.price*(disc/100))+(s.price*(specialdisc/100))+(s.price*(termdisc/100))+disc2+disc3)*-1) as disc,
--DJS tried using the disc name first but didnt work
s.price + (((s.price*(disc/100))+(s.price*(specialdisc/100))+(s.price*(termdisc/100))+disc2+disc3)*-1) as netprice,
--(select ((qtyshp1*extprice1)+(qtyshp2*extprice2)+(qtyshp3*extprice3)) from taxitem(@sono,[lineno])) as tax,
s.price,extprice,icitem.sunmsid
from pkpro..sotran as s,
icitem
where sono = @sono
and s.item = icitem.item
GO
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only