i want to know if a stored procedure has records, because if it does n't i want to skip a part of my code .
i'm printing several reports, in a batch and when a record has no data it ends the batch.
the code that i'm using is
where ajar and rechthebbende are values from the main form
"SELECT count DISTINCT dbo.ro_results.ISBN, dbo.PI_rechthebbende.btw, dbo.PI_rechthebbende.land, dbo.PI_rechthebbende.Rechthebbende_nr, " _
& " dbo.PI_artikel_informatie.actief, dbo.ro_results.Rol, dbo.[PI_ISBN-Rechthebbende].Rechthebbende_nr AS Expr2, dbo.PI_rechthebbende.voorletters, " _
& " dbo.ro_results.Jaar , dbo.[PI_ISBN-Rechthebbende].Verdeelsleutel " _
& " FROM dbo.PI_rechthebbende INNER JOIN dbo.PI_artikel_informatie INNER JOIN dbo.ro_results ON dbo.PI_artikel_informatie.ISBN = dbo.ro_results.ISBN INNER JOIN " _
& " dbo.[PI_ISBN-Rechthebbende] ON dbo.PI_artikel_informatie.ISBN = dbo.[PI_ISBN-Rechthebbende].ISBN AND " _
& " dbo.ro_results.Rol = dbo.[PI_ISBN-Rechthebbende].Rol ON " _
& " dbo.PI_rechthebbende.Rechthebbende_nr = dbo.[PI_ISBN-Rechthebbende].Rechthebbende " _
& " WHERE (NOT (dbo.[PI_ISBN-Rechthebbende].Rechthebbende_nr IS NULL)) AND (dbo.PI_rechthebbende.Rechthebbende_nr = ' " & Rechthebbende & " ')" _
& " AND (dbo.ro_results.jaar = ' " & Jaar & " ')"
Our community of experts have been thoroughly vetted for their expertise and industry experience.