Errore creazione condizione query di selezione da esperto di selezione...

venerdì 16 agosto 2013 - 17.24

STAR23 Profilo | Newbie

Ciao a tutti,
ho un problema con una condizione or utilizzando una formula in esperto di selezione

se eseguo le condizioni singolarmente il risultato è corretto, mentre se le unisco viene valutata solo la prima...

la formula è la seguente
{tabella1.valore1}={?parametro1} and
{?parametro2}= {tabella2.parametro2} and
{?parametro3}= {tabella2.parametro3} and
{tabella3.valore}=1 and
not {tabella4.valore} and
(
(not ISNULL({tabella4.ID_1}) and {tabella5.valore}=true )
or ({tabella6.valore2}=false and {tabella6.valore}=true and NOT ISNULL({tabella4.ID_2}))
or (not ISNULL({tabella4.ID_3}))
)

ripeto, eseguite singolarmente
{tabella1.valore1}={?parametro1} and
{?parametro2}= {tabella2.parametro2} and
{?parametro3}= {tabella2.parametro3} and
{tabella3.valore}=1 and
not {tabella4.valore} and
(not ISNULL({tabella4.ID_1}) and {tabella5.valore}=true )

e
{tabella1.valore1}={?parametro1} and
{?parametro2}= {tabella2.parametro2} and
{?parametro3}= {tabella2.parametro3} and
{tabella3.valore}=1 and
not {tabella4.valore} and
({tabella6.valore2}=false and {tabella6.valore}=true and NOT ISNULL({tabella4.ID_2})

e
{tabella1.valore1}={?parametro1} and
{?parametro2}= {tabella2.parametro2} and
{?parametro3}= {tabella2.parametro3} and
{tabella3.valore}=1 and
not {tabella4.valore} and
not ISNULL({tabella4.ID_3})

selezionano i dati corretti

quando controllo la query di selezione praticamente non tiene conto delle parentesi e mette tutti gli and/or di file...
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5