Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsI want to check if the value of one field fals between the value of an other field, then have an result and than compare that the same way.
in the mdb version i used an query:
INSERT INTO royaltieafrekening ( ISBN, [prijs bin per1], [prijs bin per 2], eindsom, vorigjaar, eindsom2, afdracht2, [>0 per1], [>0 per2], kat, ntper1, verkooptotaal, verkooptotaal2, ntper2, [percent], rechthebbende, van, tot, percentage )
SELECT royalties_auteurs.ISBN, [totale verkopen].[prijs bin per1], [totale verkopen].[prijs bin per 2], IIf([verkooptotaalbin]<[va
FROM (royalties_auteurs INNER JOIN stafffelauteur ON royalties_auteurs.ISBN = stafffelauteur.isbn) INNER JOIN [totale verkopen] ON royalties_auteurs.ISBN = [totale verkopen].isbn
WHERE (((royalties_auteurs.ISBN)
ORDER BY stafffelauteur.percentage;
from wich i need to know how to get the same result in an stored procedure, for the following line:
eindsom: IIf([verkooptotaalbin]<[va
so far i have :
Alter Procedure [test voor royalties]
As
set nocount on
DECLARE @SQL nvarchar(600)
DECLARE @Teller tinyint
DECLARE @staf1 int
create table #RO_test
(
ISBN varchar(10) NOT NULL,
rol varchar(10) ,
staffel int,
percentage int,
totalevj int,
land nvarchar(3) not null,
aantalvk int,
verkochtperstaffel int,
aantal int ,
van int
)
INSERT into #RO_test (ISBN, rol, staffel, percentage,totalevj,land,a
SELECT([PI_ISBN-Rechthebbe
[PI_ISBN-Rechthebbende].Ro
PI_Calculaties_staffel.Aan
PI_Calculaties_staffel.Per
[resultaat correcties royalties].[totale verkopen vorig jaar],
[verkopen totaal per jaar en per land].land,
[verkopen totaal per jaar en per land].Expr1 AS aantal_verkocht,
0 as verkochtperstaffel,
0 as aantal,van
FROM dbo.[PI_ISBN-Rechthebbende
dbo.[resultaat correcties royalties] ON
dbo.[PI_ISBN-Rechthebbende
INNER JOIN
dbo.[verkopen totaal per jaar en per land] ON
dbo.[PI_ISBN-Rechthebbende
LEFT OUTER JOIN
dbo.PI_Calculaties_staffel
dbo.[PI_ISBN-Rechthebbende
WHERE (dbo.[PI_ISBN-Rechthebbend
(dbo.[verkopen totaal per jaar en per land].land = 'NL')AND
(dbo.[PI_ISBN-Rechthebbend
UPDATE #RO_test
SET @teller = (select count(*) FROM #RO_test)
FROM #RO_test
UPDATE #RO_test
SET #RO_test.verkochtperstaffe
FROM #RO_test
UPDATE #RO_test
set @staf1 = #RO_test.verkochtperstaffe
FROM #RO_test
UPDATE #RO_test
SET #RO_test.aantal = @teller
FROM #RO_test
select * from #RO_test
return
the problem is that the result should be the result - the previous result
Thanxs
Timo
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: adatheladPosted on 2003-02-13 at 04:31:58ID: 7941361
Comments are available to members only. Sign up or Log in to view these comments.