[RESOLVED] whats wrong in my query
hi,
Im building a form on wich the user can choose to send an email to people with email, depending (filtered) on criteria.
The filtered students are shown in a listview.
my sql query is;
all filters work as I planned But then;
as soon as I start filtering with Weekdays "Monday", "Tuesday" etc. ( strWeekDayClause will be like AND TWeekdag.Weekdag = 'Maandag' OR TWeekdag.Weekdag = 'Dinsdag')
using a query tool I see that "suddenly" also Emailaddress with a value NULL are shown! I ONLY want the query to return the ones with an emailaddress.
ofcourse my listview blows, because it can's display a subitem with an Empty string
someone?
how do I make the right query?
thx in advance
hi,
Im building a form on wich the user can choose to send an email to people with email, depending (filtered) on criteria.
The filtered students are shown in a listview.
my sql query is;
VB.NET:
[SIZE=1]
strSQL = "SELECT DISTINCT TAdresBoek.CursistID, TAdresBoek.AchterNaam + ', ' + TAdresBoek.VoorNaam + ISNULL(+ ' ' + TAdresBoek.TussenVoegsel, '') AS Naam, " _
& " TAdresBoek.EmailAdres, TWeekdag.Weekdag AS Weekdag, TInschrijving.Plezier, TInschrijving.OpNivo, TCursussen.Cursus AS Cursus, " _
& " TBetalingen.Betaald " _
& " FROM TInschrijving " _
& " INNER JOIN " _
& " TWeekdag ON TInschrijving.Weekdag = TWeekdag.WeekDagid INNER JOIN " _
& " TLocaties ON TInschrijving.Locatie = TLocaties.LocatieID INNER JOIN " _
& " TCursussen ON TInschrijving.Cursus = TCursussen.CursusID INNER JOIN " _
& " TBetalingen ON TInschrijving.InschrijvingsID = TBetalingen.Inschrijvingsid RIGHT OUTER JOIN " _
& " TAdresBoek ON TInschrijving.CursistID = TAdresBoek.CursistID CROSS JOIN " _
& " TDansSoort " _
& " WHERE TAdresBoek.EmailAdres <> ' '"
strSQL = strSQL & strActiefClause & strOpNivoClause & strPlezierClause & strStudentClause _
& strACardClause & strShowgroepClause & strBetaaldClause & strWeekdagClause
[/SIZE]
all filters work as I planned But then;
as soon as I start filtering with Weekdays "Monday", "Tuesday" etc. ( strWeekDayClause will be like AND TWeekdag.Weekdag = 'Maandag' OR TWeekdag.Weekdag = 'Dinsdag')
using a query tool I see that "suddenly" also Emailaddress with a value NULL are shown! I ONLY want the query to return the ones with an emailaddress.
ofcourse my listview blows, because it can's display a subitem with an Empty string
someone?
how do I make the right query?
thx in advance
Last edited: