Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
ls_filter = "v_car_truck_bus_trailer_materiaal_id = " +string(ll_materiaalid) +" AND ('" +  string(idt_referentiedatum,"yyyy-mm-dd") + "' > 'dt_geldigvan' OR IsNull ('dt_geldigvan')) AND ( '" +  string(idt_referentiedatum,"yyyy-mm-dd") + "' <  'dt_geldigtot' or IsNull ('dt_geldigtot'))"


whats the difference between the filterstring above and the query below?


SQL
select kentekennummer, p.personeelsnr, bp.dt_geldigvan, bp.dt_geldigtot,vctbt.materiaal_id
from gloriant.v_car_truck_bus_trailer as vctbt
left join gloriant.bestemmingsgoed_personeel as bp on bp.bestemmingsgoed_id = vctbt.bestemmingsgoed_id
left join gloriant.personeel as p on bp.personeel_id = p.id
where vctbt.dossier_id = 1
and materiaal_id = @index
and( '2012-12-25' > dt_geldigvan or dt_geldigvan is null)
and ( '2012-12-25' < dt_geldigtot or dt_geldigtot is null)



they should do the same..
Posted
Updated 23-Aug-13 0:26am
v2
Comments
Sudhakar Shinde 23-Aug-13 7:45am    
filter is applied to a datawindow level which internally generates query after applying the filter. Did not understand your question though.
Sam Van den Bossche 23-Aug-13 8:58am    
I have a query ( the one displayed ) and I want to replace the where part with a filter in code..
but the filter does not gives the same result as the query and my question was does anybody see the difference

1 solution

The filters are different, on the most basic level, so they are not 'the same'. Emit your SQL in code to see what your string mashing is creating, to see how it differs. Also, this is horrible, don't do it. Use paramaterised queries if you must string mash SQL.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900