Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select into function
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Select into function
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01076328
Message ID:
01076328
Vues:
55
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform