﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Reporting Services / Reporting Services 2005 Development  / SSRS - Report Builder 2.0 - SQL query generation - Order of fields dragged on the report changes the generated query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 07:53:34 GMT</lastBuildDate><ttl>20</ttl><item><title>SSRS - Report Builder 2.0 - SQL query generation - Order of fields dragged on the report changes the generated query</title><link>http://www.sqlservercentral.com/Forums/Topic770434-1063-1.aspx</link><description>say, I have 3 tables : [b]Toys[/b], [b]Baby[/b], [b]Diapers[/b].one [b]Baby[/b] can have zero or many [b]Toys[/b] and zero or many [b]Diapers[/b] as well.[b] (Toy - M:1 - Baby - 1:M - Diaper)[/b]now in the report I am trying to put together Count of Toys per Baby, showing also Diapers Descr, when available.if I drag Baby Name first, then Diaper Descr and then right after that I drop Count of Toys - I get only result set for data with Diapers and Toys present, and data where Diapers=null is not in the report!in the resulting query I get subselect A (Baby + Diaper) joined to subselect B (Baby + Toy) on Baby ID (which is OK) and Diaper Description!!! which is NOT OK, because all data about Toys for null Diapers gets cut offif, however, I drag Diaper first, then Baby, then Count of Toys - I get full result set even for Babies without Diapers. In the resulting queries I have subselects too, but they are joined on BabyID only.Why is the order of columns that we drag changes the query so drastically? How can we control that?(Note: Diapers and Toys are named queries which are full outer joined to Baby for all BabyIDs, so even if Baby doesn't have Diaper - there will be an entry in Diapers view with Diaper Descr = null)</description><pubDate>Thu, 13 Aug 2009 12:53:00 GMT</pubDate><dc:creator>Aedna</dc:creator></item></channel></rss>