Hi,
I have this select and I wil translate in Reports:
Select *
from Sharepoint_Leden.dbo.VW_Ondernemingen a
where Stopdatum is null
and Lidstatus in (4,5,6)
and Provincie between 1 and 37
and not exists (select 'X'
from Sharepoint_Leden.dbo.VW_Voordelen b
where Voordeelcode = 2
and a.Identnr = b.Identnr
and datediff(day,b.Startdatum, GETDATE()) >= 0
and datediff(day,b.Einddatum, GETDATE()) <= 0)
The words in red are the values for pQueryON.
At the moment, I have the members that don’t have Sabam and I want to add a test that gives me the persons who don’t have sabam today(shown in blue), I don’t know if it’s possible:
<?xml version="1.0" encoding="utf-8" ?>
<root>
<list title="Ondernemingen" relativeSiteUrl="/LedenDevelopment" tableName="Ondernemingen" useDisplayName="false">
<fields>Identnr, Lidnr, FED, Provincie, BV, Taal, Lid_x0020_Aanspreektitel, Title, Lid_x0020_Voornaam, Adres_x0020_Straat, Adres_x0020_Nummer, Adres_x0020_Bus, Plaats_x0020_Postcode, Plaats_x0020_Gemeente, Uitbater_x0020_Aanspreektitel, Uitbater_x0020_Naam, Uitbater_x0020_Voornaam, Uitbater_x0020_Adres_x0020_Straa, Uitbater_x0020_Adres_x0020_Numme, Uitbater_x0020_Adres_x0020_Bus, Uitbater_x0020_Plaats_x0020_Post, Uitbater_x0020_Plaats_x0020_Geme, Rechtspersoon_x0020_Juridische_x, Bedrijfsnaam, Uithangbord_x0020_Naam, Brief, Lidstatus, Stopdatum, Lidmaatschap_x0020_Van</fields>
<query>@pQueryON!</query>
</list>
<list title="Ondernemingen" relativeSiteUrl="/LedenDevelopment" tableName="Ondernemingen2" useDisplayName="false">
<fields>Identnr</fields>
<query></query>
</list>
<list title="Voordelen" relativeSiteUrl="/LedenDevelopment" tableName="Voordelen" useDisplayName="false">
<fields>Identnr, Voordeelcode</fields>
<query></query>
</list>
<sqlOp op="outerjoin">
<dstTableName>VSabam1</dstTableName>
<parentTableName>Ondernemingen2</parentTableName>
<childTableName>Voordelen</childTableName>
<parentFieldName>Identnr</parentFieldName>
<childFieldName>Identnr</childFieldName>
</sqlOp>
<sqlOp op="select">
<dstTableName>VSabam2</dstTableName>
<sourceTableName>VSabam1</sourceTableName>
<selectExpression><![CDATA[Voordeelcode = 'SABAM']]></selectExpression>
</sqlOp>
<sqlOp op="outerjoin">
<dstTableName>VSabam3</dstTableName>
<parentTableName>Ondernemingen</parentTableName>
<childTableName>VSabam2</childTableName>
<parentFieldName>Identnr</parentFieldName>
<childFieldName>Identnr</childFieldName>
</sqlOp>
<sqlOp op="select">
<dstTableName>Sabam</dstTableName>
<sourceTableName>VSabam3</sourceTableName>
<selectExpression><![CDATA[IsNull(VSabam2.Identnr,'') = '']]></selectExpression>
</sqlOp>
<resultSet>Sabam</resultSet>
</root>
Thanks
Sylvie