Hi, In the parameter properties dialogue box, i want to set the Default Value of a parameter as null. how can I do that? I tried = Null in the Default value. But that didnt work. Any help is appreciated. Thanks --
Set the default value to =Nothing ('Nothing' is the VB keyword for representing a NULL) -- Robert This posting is provided "AS IS" with no warranties, and confers no rights. [quoted text, click to view] "pmud" <pmud@discussions.microsoft.com> wrote in message news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... > Hi, > > In the parameter properties dialogue box, i want to set the Default Value > of > a parameter as null. how can I do that? > > I tried = Null in the Default value. But that didnt work. > > Any help is appreciated. > > Thanks > -- > pmud
Hi Robert, I tried =Nothing , it didnt work. My problem is that I have a report with a matrix with a row and column called Carrier and Month respectively. This report has around 10 parameters and allows the users to view the report based on one or all of the parameters of this report. Now when the data cell of the matrix is clicked, it jumps to the subreport. Now the problem is that when the user doesnt select any of the parameters & ets thier value remain as null ( so that they show data for all ratger than a specific parameter) , then when it jumps to the details report, the report doesnt show up 'coz the paramater is sghown as blank. What I want is, that if the user selects NULL, for any or all parametres, then in the sub report, it should atuomatically take that parameter to show all values. How can this be done? Below is the sample query I use in my details report: SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE FROM IRUS_INVOICES WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) AND (BILL_TYPE = @billType) OR (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) AND (@billType IS NULL) Here the parameter Bill_Type is passed from the main matrix report. But if the user chooses Null as the parameter in the main report, then this details report, doesnt show any data . When I check the box next to Bill_Type ( in details repotr), then it shows data. How can I modify my query so that if user just selects null for any or all parameters in main report, then the details report automatically shows the data with that parameter as null i.e showing all data irrespective of that parameter. Please help. Thanks -- pmud [quoted text, click to view] "Robert Bruckner [MSFT]" wrote: > Set the default value to =Nothing > > ('Nothing' is the VB keyword for representing a NULL) > > > -- Robert > This posting is provided "AS IS" with no warranties, and confers no rights. > > > "pmud" <pmud@discussions.microsoft.com> wrote in message > news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... > > Hi, > > > > In the parameter properties dialogue box, i want to set the Default Value > > of > > a parameter as null. how can I do that? > > > > I tried = Null in the Default value. But that didnt work. > > > > Any help is appreciated. > > > > Thanks > > -- > > pmud > >
Hi pmud, I think you just have a problem with order of operations in the query, try [quoted text, click to view] > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, > CONTRACT_LENGTH, CARRIER_CODE > FROM IRUS_INVOICES > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) > AND ((BILL_TYPE = @billType) OR (@billType IS NULL))
I hope that helps! Chris [quoted text, click to view] "pmud" <pmud@discussions.microsoft.com> wrote in message news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... > Hi Robert, > > I tried =Nothing , it didnt work. My problem is that I have a report with > a > matrix with a row and column called Carrier and Month respectively. This > report has around 10 parameters and allows the users to view the report > based > on one or all of the parameters of this report. Now when the data cell > of > the matrix is clicked, it jumps to the subreport. > > Now the problem is that when the user doesnt select any of the parameters > & > ets thier value remain as null ( so that they show data for all ratger > than a > specific parameter) , then when it jumps to the details report, the report > doesnt show up 'coz the paramater is sghown as blank. What I want is, that > if > the user selects NULL, for any or all parametres, then in the sub report, > it > should atuomatically take that parameter to show all values. How can this > be > done? Below is the sample query I use in my details report: > > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, > CONTRACT_LENGTH, CARRIER_CODE > FROM IRUS_INVOICES > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) > AND (BILL_TYPE = @billType) OR > (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > @orderMonth) AND (@billType IS NULL) > > Here the parameter Bill_Type is passed from the main matrix report. But if > the user chooses Null as the parameter in the main report, then this > details > report, doesnt show any data . When I check the box next to Bill_Type ( in > details repotr), then it shows data. How can I modify my query so that if > user just selects null for any or all parameters in main report, then the > details report automatically shows the data with that parameter as null > i.e > showing all data irrespective of that parameter. > > Please help. > Thanks > -- > pmud > > > "Robert Bruckner [MSFT]" wrote: > >> Set the default value to =Nothing >> >> ('Nothing' is the VB keyword for representing a NULL) >> >> >> -- Robert >> This posting is provided "AS IS" with no warranties, and confers no >> rights. >> >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message >> news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... >> > Hi, >> > >> > In the parameter properties dialogue box, i want to set the Default >> > Value >> > of >> > a parameter as null. how can I do that? >> > >> > I tried = Null in the Default value. But that didnt work. >> > >> > Any help is appreciated. >> > >> > Thanks >> > -- >> > pmud >> >> >>
Hi Chris, Thats what I had done while wrting the query but the query designer automatically restructured it to the following even though I had added paranthesis in appropriate places. Any other ideas? Thanks -- pmud [quoted text, click to view] "Chris Hastings" wrote: > Hi pmud, > I think you just have a problem with order of operations in the query, try > > > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, > > CONTRACT_LENGTH, CARRIER_CODE > > FROM IRUS_INVOICES > > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) > > AND ((BILL_TYPE = @billType) OR (@billType IS NULL)) > > I hope that helps! > Chris > > > "pmud" <pmud@discussions.microsoft.com> wrote in message > news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... > > Hi Robert, > > > > I tried =Nothing , it didnt work. My problem is that I have a report with > > a > > matrix with a row and column called Carrier and Month respectively. This > > report has around 10 parameters and allows the users to view the report > > based > > on one or all of the parameters of this report. Now when the data cell > > of > > the matrix is clicked, it jumps to the subreport. > > > > Now the problem is that when the user doesnt select any of the parameters > > & > > ets thier value remain as null ( so that they show data for all ratger > > than a > > specific parameter) , then when it jumps to the details report, the report > > doesnt show up 'coz the paramater is sghown as blank. What I want is, that > > if > > the user selects NULL, for any or all parametres, then in the sub report, > > it > > should atuomatically take that parameter to show all values. How can this > > be > > done? Below is the sample query I use in my details report: > > > > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, > > CONTRACT_LENGTH, CARRIER_CODE > > FROM IRUS_INVOICES > > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) > > AND (BILL_TYPE = @billType) OR > > (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > @orderMonth) AND (@billType IS NULL) > > > > Here the parameter Bill_Type is passed from the main matrix report. But if > > the user chooses Null as the parameter in the main report, then this > > details > > report, doesnt show any data . When I check the box next to Bill_Type ( in > > details repotr), then it shows data. How can I modify my query so that if > > user just selects null for any or all parameters in main report, then the > > details report automatically shows the data with that parameter as null > > i.e > > showing all data irrespective of that parameter. > > > > Please help. > > Thanks > > -- > > pmud > > > > > > "Robert Bruckner [MSFT]" wrote: > > > >> Set the default value to =Nothing > >> > >> ('Nothing' is the VB keyword for representing a NULL) > >> > >> > >> -- Robert > >> This posting is provided "AS IS" with no warranties, and confers no > >> rights. > >> > >> > >> "pmud" <pmud@discussions.microsoft.com> wrote in message > >> news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... > >> > Hi, > >> > > >> > In the parameter properties dialogue box, i want to set the Default > >> > Value > >> > of > >> > a parameter as null. how can I do that? > >> > > >> > I tried = Null in the Default value. But that didnt work. > >> > > >> > Any help is appreciated. > >> > > >> > Thanks > >> > -- > >> > pmud > >> > >> > >> > >
Hi chris, I have already tried this and I get the "Syntax error or access violation ". I cant seem to find the error. IF @billType is NULL BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE FROM IRUS_INVOICES WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) END ELSE BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE FROM IRUS_INVOICES WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) AND (BILL_TYPE = @billType) END My second concern is that, I need to pass one or more of the 10 parameters available to the user. So making the combinations of "If else" statements will be almost impossible, since at a time any number of parameters the user can select or leave any number of them as null. So, I was wondering if a case statement will help. But how do I structure that? Thanks -- pmud [quoted text, click to view] "Chris Hastings" wrote: > That's craziness! Sometimes I wonder about that query designer... > You could try... > > IF @billType IS NULL > BEGIN > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, > CONTRACT_LENGTH, CARRIER_CODE > FROM IRUS_INVOICES > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > @orderMonth) > END > ELSE > BEGIN > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, > CONTRACT_LENGTH, CARRIER_CODE > FROM IRUS_INVOICES > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > @orderMonth) > AND (BILL_TYPE = @billType) > END > > It seems like there should be a better way, but I'm not sure what it is. > I hope that works! > Chris > > > "pmud" <pmud@discussions.microsoft.com> wrote in message > news:DFCCC16F-1A2B-4D09-9BBE-1D4140699025@microsoft.com... > > Hi Chris, > > > > Thats what I had done while wrting the query but the query designer > > automatically restructured it to the following even though I had added > > paranthesis in appropriate places. > > > > Any other ideas? > > > > Thanks > > -- > > pmud > > > > > > "Chris Hastings" wrote: > > > >> Hi pmud, > >> I think you just have a problem with order of operations in the query, > >> try > >> > >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > >> > SALES_METHOD, > >> > CONTRACT_LENGTH, CARRIER_CODE > >> > FROM IRUS_INVOICES > >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> > @orderMonth) > >> > AND ((BILL_TYPE = @billType) OR (@billType IS NULL)) > >> > >> I hope that helps! > >> Chris > >> > >> > >> "pmud" <pmud@discussions.microsoft.com> wrote in message > >> news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... > >> > Hi Robert, > >> > > >> > I tried =Nothing , it didnt work. My problem is that I have a report > >> > with > >> > a > >> > matrix with a row and column called Carrier and Month respectively. > >> > This > >> > report has around 10 parameters and allows the users to view the report > >> > based > >> > on one or all of the parameters of this report. Now when the data > >> > cell > >> > of > >> > the matrix is clicked, it jumps to the subreport. > >> > > >> > Now the problem is that when the user doesnt select any of the > >> > parameters > >> > & > >> > ets thier value remain as null ( so that they show data for all ratger > >> > than a > >> > specific parameter) , then when it jumps to the details report, the > >> > report > >> > doesnt show up 'coz the paramater is sghown as blank. What I want is, > >> > that > >> > if > >> > the user selects NULL, for any or all parametres, then in the sub > >> > report, > >> > it > >> > should atuomatically take that parameter to show all values. How can > >> > this > >> > be > >> > done? Below is the sample query I use in my details report: > >> > > >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > >> > SALES_METHOD, > >> > CONTRACT_LENGTH, CARRIER_CODE > >> > FROM IRUS_INVOICES > >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> > @orderMonth) > >> > AND (BILL_TYPE = @billType) OR > >> > (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> > @orderMonth) AND (@billType IS NULL) > >> > > >> > Here the parameter Bill_Type is passed from the main matrix report. But > >> > if > >> > the user chooses Null as the parameter in the main report, then this > >> > details > >> > report, doesnt show any data . When I check the box next to Bill_Type > >> > ( in > >> > details repotr), then it shows data. How can I modify my query so that > >> > if > >> > user just selects null for any or all parameters in main report, then > >> > the > >> > details report automatically shows the data with that parameter as null > >> > i.e > >> > showing all data irrespective of that parameter. > >> > > >> > Please help. > >> > Thanks > >> > -- > >> > pmud > >> > > >> > > >> > "Robert Bruckner [MSFT]" wrote: > >> > > >> >> Set the default value to =Nothing > >> >> > >> >> ('Nothing' is the VB keyword for representing a NULL) > >> >> > >> >> > >> >> -- Robert > >> >> This posting is provided "AS IS" with no warranties, and confers no > >> >> rights. > >> >> > >> >> > >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message > >> >> news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... > >> >> > Hi, > >> >> > > >> >> > In the parameter properties dialogue box, i want to set the Default > >> >> > Value > >> >> > of > >> >> > a parameter as null. how can I do that? > >> >> > > >> >> > I tried = Null in the Default value. But that didnt work. > >> >> > > >> >> > Any help is appreciated. > >> >> > > >> >> > Thanks > >> >> > -- > >> >> > pmud > >> >> > >> >> > >> >> > >> > >> > >> > >
That's craziness! Sometimes I wonder about that query designer... You could try... IF @billType IS NULL BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE FROM IRUS_INVOICES WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) END ELSE BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE FROM IRUS_INVOICES WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = @orderMonth) AND (BILL_TYPE = @billType) END It seems like there should be a better way, but I'm not sure what it is. I hope that works! Chris [quoted text, click to view] "pmud" <pmud@discussions.microsoft.com> wrote in message news:DFCCC16F-1A2B-4D09-9BBE-1D4140699025@microsoft.com... > Hi Chris, > > Thats what I had done while wrting the query but the query designer > automatically restructured it to the following even though I had added > paranthesis in appropriate places. > > Any other ideas? > > Thanks > -- > pmud > > > "Chris Hastings" wrote: > >> Hi pmud, >> I think you just have a problem with order of operations in the query, >> try >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, >> > SALES_METHOD, >> > CONTRACT_LENGTH, CARRIER_CODE >> > FROM IRUS_INVOICES >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> > @orderMonth) >> > AND ((BILL_TYPE = @billType) OR (@billType IS NULL)) >> >> I hope that helps! >> Chris >> >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message >> news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... >> > Hi Robert, >> > >> > I tried =Nothing , it didnt work. My problem is that I have a report >> > with >> > a >> > matrix with a row and column called Carrier and Month respectively. >> > This >> > report has around 10 parameters and allows the users to view the report >> > based >> > on one or all of the parameters of this report. Now when the data >> > cell >> > of >> > the matrix is clicked, it jumps to the subreport. >> > >> > Now the problem is that when the user doesnt select any of the >> > parameters >> > & >> > ets thier value remain as null ( so that they show data for all ratger >> > than a >> > specific parameter) , then when it jumps to the details report, the >> > report >> > doesnt show up 'coz the paramater is sghown as blank. What I want is, >> > that >> > if >> > the user selects NULL, for any or all parametres, then in the sub >> > report, >> > it >> > should atuomatically take that parameter to show all values. How can >> > this >> > be >> > done? Below is the sample query I use in my details report: >> > >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, >> > SALES_METHOD, >> > CONTRACT_LENGTH, CARRIER_CODE >> > FROM IRUS_INVOICES >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> > @orderMonth) >> > AND (BILL_TYPE = @billType) OR >> > (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> > @orderMonth) AND (@billType IS NULL) >> > >> > Here the parameter Bill_Type is passed from the main matrix report. But >> > if >> > the user chooses Null as the parameter in the main report, then this >> > details >> > report, doesnt show any data . When I check the box next to Bill_Type >> > ( in >> > details repotr), then it shows data. How can I modify my query so that >> > if >> > user just selects null for any or all parameters in main report, then >> > the >> > details report automatically shows the data with that parameter as null >> > i.e >> > showing all data irrespective of that parameter. >> > >> > Please help. >> > Thanks >> > -- >> > pmud >> > >> > >> > "Robert Bruckner [MSFT]" wrote: >> > >> >> Set the default value to =Nothing >> >> >> >> ('Nothing' is the VB keyword for representing a NULL) >> >> >> >> >> >> -- Robert >> >> This posting is provided "AS IS" with no warranties, and confers no >> >> rights. >> >> >> >> >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message >> >> news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... >> >> > Hi, >> >> > >> >> > In the parameter properties dialogue box, i want to set the Default >> >> > Value >> >> > of >> >> > a parameter as null. how can I do that? >> >> > >> >> > I tried = Null in the Default value. But that didnt work. >> >> > >> >> > Any help is appreciated. >> >> > >> >> > Thanks >> >> > -- >> >> > pmud >> >> >> >> >> >> >> >> >>
Stupid designer! I went in to design a report and tried what you are doing and I get the same error. a couple of things, are you using SQL for the data? If so, we can make a stored procedure where you pass all of the info in as parameters and we can do whatever we want to there and get away from the graphical design tool. Or you can shut it off the graphical design porting in SQL reports. A stored proc is probably the best. It is more efficient and it is easy to call from reports. Let me know if you want any assistance with that. Chris [quoted text, click to view] "pmud" <pmud@discussions.microsoft.com> wrote in message news:B357E2D5-C743-488F-A967-CA4E32DB1260@microsoft.com... > Hi chris, > > I have already tried this and I get the "Syntax error or access violation > ". > I cant seem to find the error. > > IF @billType is NULL > BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE > FROM IRUS_INVOICES > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > @orderMonth) END > ELSE BEGIN > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, > PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE > FROM IRUS_INVOICES > WHERE (CARRIER_CODE = @carrier) AND > (MONTH(ORDER_DATE) = @orderMonth) AND (BILL_TYPE = @billType) > END > > My second concern is that, I need to pass one or more of the 10 parameters > available to the user. So making the combinations of "If else" statements > will be almost impossible, since at a time any number of parameters the > user > can select or leave any number of them as null. > > So, I was wondering if a case statement will help. But how do I structure > that? > > Thanks > -- > pmud > > > "Chris Hastings" wrote: > >> That's craziness! Sometimes I wonder about that query designer... >> You could try... >> >> IF @billType IS NULL >> BEGIN >> SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, >> SALES_METHOD, >> CONTRACT_LENGTH, CARRIER_CODE >> FROM IRUS_INVOICES >> WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> @orderMonth) >> END >> ELSE >> BEGIN >> SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, >> SALES_METHOD, >> CONTRACT_LENGTH, CARRIER_CODE >> FROM IRUS_INVOICES >> WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> @orderMonth) >> AND (BILL_TYPE = @billType) >> END >> >> It seems like there should be a better way, but I'm not sure what it is. >> I hope that works! >> Chris >> >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message >> news:DFCCC16F-1A2B-4D09-9BBE-1D4140699025@microsoft.com... >> > Hi Chris, >> > >> > Thats what I had done while wrting the query but the query designer >> > automatically restructured it to the following even though I had added >> > paranthesis in appropriate places. >> > >> > Any other ideas? >> > >> > Thanks >> > -- >> > pmud >> > >> > >> > "Chris Hastings" wrote: >> > >> >> Hi pmud, >> >> I think you just have a problem with order of operations in the query, >> >> try >> >> >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, >> >> > SALES_METHOD, >> >> > CONTRACT_LENGTH, CARRIER_CODE >> >> > FROM IRUS_INVOICES >> >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> >> > @orderMonth) >> >> > AND ((BILL_TYPE = @billType) OR (@billType IS NULL)) >> >> >> >> I hope that helps! >> >> Chris >> >> >> >> >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message >> >> news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... >> >> > Hi Robert, >> >> > >> >> > I tried =Nothing , it didnt work. My problem is that I have a report >> >> > with >> >> > a >> >> > matrix with a row and column called Carrier and Month respectively. >> >> > This >> >> > report has around 10 parameters and allows the users to view the >> >> > report >> >> > based >> >> > on one or all of the parameters of this report. Now when the data >> >> > cell >> >> > of >> >> > the matrix is clicked, it jumps to the subreport. >> >> > >> >> > Now the problem is that when the user doesnt select any of the >> >> > parameters >> >> > & >> >> > ets thier value remain as null ( so that they show data for all >> >> > ratger >> >> > than a >> >> > specific parameter) , then when it jumps to the details report, the >> >> > report >> >> > doesnt show up 'coz the paramater is sghown as blank. What I want >> >> > is, >> >> > that >> >> > if >> >> > the user selects NULL, for any or all parametres, then in the sub >> >> > report, >> >> > it >> >> > should atuomatically take that parameter to show all values. How can >> >> > this >> >> > be >> >> > done? Below is the sample query I use in my details report: >> >> > >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, >> >> > SALES_METHOD, >> >> > CONTRACT_LENGTH, CARRIER_CODE >> >> > FROM IRUS_INVOICES >> >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = >> >> > @orderMonth) >> >> > AND (BILL_TYPE = @billType) OR >> >> > (CARRIER_CODE = @carrier) AND >> >> > (MONTH(ORDER_DATE) = >> >> > @orderMonth) AND (@billType IS NULL) >> >> > >> >> > Here the parameter Bill_Type is passed from the main matrix report. >> >> > But >> >> > if >> >> > the user chooses Null as the parameter in the main report, then this >> >> > details >> >> > report, doesnt show any data . When I check the box next to >> >> > Bill_Type >> >> > ( in >> >> > details repotr), then it shows data. How can I modify my query so >> >> > that >> >> > if >> >> > user just selects null for any or all parameters in main report, >> >> > then >> >> > the >> >> > details report automatically shows the data with that parameter as >> >> > null >> >> > i.e >> >> > showing all data irrespective of that parameter. >> >> > >> >> > Please help. >> >> > Thanks >> >> > -- >> >> > pmud >> >> > >> >> > >> >> > "Robert Bruckner [MSFT]" wrote: >> >> > >> >> >> Set the default value to =Nothing >> >> >> >> >> >> ('Nothing' is the VB keyword for representing a NULL) >> >> >> >> >> >> >> >> >> -- Robert >> >> >> This posting is provided "AS IS" with no warranties, and confers no >> >> >> rights. >> >> >> >> >> >> >> >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message >> >> >> news:02A6F377-7A37-40F4-AF63-D3C751A1CDE4@microsoft.com... >> >> >> > Hi, >> >> >> > >> >> >> > In the parameter properties dialogue box, i want to set the >> >> >> > Default >> >> >> > Value >> >> >> > of >> >> >> > a parameter as null. how can I do that? >> >> >> > >> >> >> > I tried = Null in the Default value. But that didnt work. >> >> >> > >> >> >> > Any help is appreciated. >> >> >> >
Yes Chris. You are right. Stored Procedure will be a good idea. I will try that and let you know if that solves my problem. Thanks -- pmud [quoted text, click to view] "Chris Hastings" wrote: > Stupid designer! > I went in to design a report and tried what you are doing and I get the same > error. > a couple of things, are you using SQL for the data? If so, we can make a > stored procedure where you pass all of the info in as parameters and we can > do whatever we want to there and get away from the graphical design tool. > Or you can shut it off the graphical design porting in SQL reports. > A stored proc is probably the best. It is more efficient and it is easy to > call from reports. > Let me know if you want any assistance with that. > Chris > > "pmud" <pmud@discussions.microsoft.com> wrote in message > news:B357E2D5-C743-488F-A967-CA4E32DB1260@microsoft.com... > > Hi chris, > > > > I have already tried this and I get the "Syntax error or access violation > > ". > > I cant seem to find the error. > > > > IF @billType is NULL > > BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > > SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE > > FROM IRUS_INVOICES > > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > @orderMonth) END > > ELSE BEGIN > > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, > > PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE > > FROM IRUS_INVOICES > > WHERE (CARRIER_CODE = @carrier) AND > > (MONTH(ORDER_DATE) = @orderMonth) AND (BILL_TYPE = @billType) > > END > > > > My second concern is that, I need to pass one or more of the 10 parameters > > available to the user. So making the combinations of "If else" statements > > will be almost impossible, since at a time any number of parameters the > > user > > can select or leave any number of them as null. > > > > So, I was wondering if a case statement will help. But how do I structure > > that? > > > > Thanks > > -- > > pmud > > > > > > "Chris Hastings" wrote: > > > >> That's craziness! Sometimes I wonder about that query designer... > >> You could try... > >> > >> IF @billType IS NULL > >> BEGIN > >> SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > >> SALES_METHOD, > >> CONTRACT_LENGTH, CARRIER_CODE > >> FROM IRUS_INVOICES > >> WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> @orderMonth) > >> END > >> ELSE > >> BEGIN > >> SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > >> SALES_METHOD, > >> CONTRACT_LENGTH, CARRIER_CODE > >> FROM IRUS_INVOICES > >> WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> @orderMonth) > >> AND (BILL_TYPE = @billType) > >> END > >> > >> It seems like there should be a better way, but I'm not sure what it is. > >> I hope that works! > >> Chris > >> > >> > >> "pmud" <pmud@discussions.microsoft.com> wrote in message > >> news:DFCCC16F-1A2B-4D09-9BBE-1D4140699025@microsoft.com... > >> > Hi Chris, > >> > > >> > Thats what I had done while wrting the query but the query designer > >> > automatically restructured it to the following even though I had added > >> > paranthesis in appropriate places. > >> > > >> > Any other ideas? > >> > > >> > Thanks > >> > -- > >> > pmud > >> > > >> > > >> > "Chris Hastings" wrote: > >> > > >> >> Hi pmud, > >> >> I think you just have a problem with order of operations in the query, > >> >> try > >> >> > >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > >> >> > SALES_METHOD, > >> >> > CONTRACT_LENGTH, CARRIER_CODE > >> >> > FROM IRUS_INVOICES > >> >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> >> > @orderMonth) > >> >> > AND ((BILL_TYPE = @billType) OR (@billType IS NULL)) > >> >> > >> >> I hope that helps! > >> >> Chris > >> >> > >> >> > >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message > >> >> news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... > >> >> > Hi Robert, > >> >> > > >> >> > I tried =Nothing , it didnt work. My problem is that I have a report > >> >> > with > >> >> > a > >> >> > matrix with a row and column called Carrier and Month respectively. > >> >> > This > >> >> > report has around 10 parameters and allows the users to view the > >> >> > report > >> >> > based > >> >> > on one or all of the parameters of this report. Now when the data > >> >> > cell > >> >> > of > >> >> > the matrix is clicked, it jumps to the subreport. > >> >> > > >> >> > Now the problem is that when the user doesnt select any of the > >> >> > parameters > >> >> > & > >> >> > ets thier value remain as null ( so that they show data for all > >> >> > ratger > >> >> > than a > >> >> > specific parameter) , then when it jumps to the details report, the > >> >> > report > >> >> > doesnt show up 'coz the paramater is sghown as blank. What I want > >> >> > is, > >> >> > that > >> >> > if > >> >> > the user selects NULL, for any or all parametres, then in the sub > >> >> > report, > >> >> > it > >> >> > should atuomatically take that parameter to show all values. How can > >> >> > this > >> >> > be > >> >> > done? Below is the sample query I use in my details report: > >> >> > > >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > >> >> > SALES_METHOD, > >> >> > CONTRACT_LENGTH, CARRIER_CODE > >> >> > FROM IRUS_INVOICES > >> >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > >> >> > @orderMonth) > >> >> > AND (BILL_TYPE = @billType) OR > >> >> > (CARRIER_CODE = @carrier) AND > >> >> > (MONTH(ORDER_DATE) = > >> >> > @orderMonth) AND (@billType IS NULL) > >> >> > > >> >> > Here the parameter Bill_Type is passed from the main matrix report. > >> >> > But > >> >> > if > >> >> > the user chooses Null as the parameter in the main report, then this > >> >> > details > >> >> > report, doesnt show any data . When I check the box next to > >> >> > Bill_Type > >> >> > ( in > >> >> > details repotr), then it shows data. How can I modify my query so > >> >> > that > >> >> > if > >> >> > user just selects null for any or all parameters in main report, > >> >> > then > >> >> > the > >> >> > details report automatically shows the data with that parameter as > >> >> > null > >> >> > i.e > >> >> > showing all data irrespective of that parameter. > >> >> > > >> >> > Please help. > >> >> > Thanks > >> >> > -- > >> >> > pmud > >> >> > > >> >> > > >> >> > "Robert Bruckner [MSFT]" wrote: > >> >> > > >> >> >> Set the default value to =Nothing > >> >> >> > >> >> >> ('Nothing' is the VB keyword for representing a NULL) > >> >> >> > >> >> >> > >> >> >> -- Robert
Thanks Chris. the stored procedure worked for me. :) -- pmud [quoted text, click to view] "pmud" wrote: > Yes Chris. You are right. Stored Procedure will be a good idea. I will try > that and let you know if that solves my problem. > > Thanks > -- > pmud > > > "Chris Hastings" wrote: > > > Stupid designer! > > I went in to design a report and tried what you are doing and I get the same > > error. > > a couple of things, are you using SQL for the data? If so, we can make a > > stored procedure where you pass all of the info in as parameters and we can > > do whatever we want to there and get away from the graphical design tool. > > Or you can shut it off the graphical design porting in SQL reports. > > A stored proc is probably the best. It is more efficient and it is easy to > > call from reports. > > Let me know if you want any assistance with that. > > Chris > > > > "pmud" <pmud@discussions.microsoft.com> wrote in message > > news:B357E2D5-C743-488F-A967-CA4E32DB1260@microsoft.com... > > > Hi chris, > > > > > > I have already tried this and I get the "Syntax error or access violation > > > ". > > > I cant seem to find the error. > > > > > > IF @billType is NULL > > > BEGIN SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > > > SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE > > > FROM IRUS_INVOICES > > > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > > @orderMonth) END > > > ELSE BEGIN > > > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, > > > PORT_REQUIRED, SALES_METHOD, CONTRACT_LENGTH, CARRIER_CODE > > > FROM IRUS_INVOICES > > > WHERE (CARRIER_CODE = @carrier) AND > > > (MONTH(ORDER_DATE) = @orderMonth) AND (BILL_TYPE = @billType) > > > END > > > > > > My second concern is that, I need to pass one or more of the 10 parameters > > > available to the user. So making the combinations of "If else" statements > > > will be almost impossible, since at a time any number of parameters the > > > user > > > can select or leave any number of them as null. > > > > > > So, I was wondering if a case statement will help. But how do I structure > > > that? > > > > > > Thanks > > > -- > > > pmud > > > > > > > > > "Chris Hastings" wrote: > > > > > >> That's craziness! Sometimes I wonder about that query designer... > > >> You could try... > > >> > > >> IF @billType IS NULL > > >> BEGIN > > >> SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > > >> SALES_METHOD, > > >> CONTRACT_LENGTH, CARRIER_CODE > > >> FROM IRUS_INVOICES > > >> WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > >> @orderMonth) > > >> END > > >> ELSE > > >> BEGIN > > >> SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > > >> SALES_METHOD, > > >> CONTRACT_LENGTH, CARRIER_CODE > > >> FROM IRUS_INVOICES > > >> WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > >> @orderMonth) > > >> AND (BILL_TYPE = @billType) > > >> END > > >> > > >> It seems like there should be a better way, but I'm not sure what it is. > > >> I hope that works! > > >> Chris > > >> > > >> > > >> "pmud" <pmud@discussions.microsoft.com> wrote in message > > >> news:DFCCC16F-1A2B-4D09-9BBE-1D4140699025@microsoft.com... > > >> > Hi Chris, > > >> > > > >> > Thats what I had done while wrting the query but the query designer > > >> > automatically restructured it to the following even though I had added > > >> > paranthesis in appropriate places. > > >> > > > >> > Any other ideas? > > >> > > > >> > Thanks > > >> > -- > > >> > pmud > > >> > > > >> > > > >> > "Chris Hastings" wrote: > > >> > > > >> >> Hi pmud, > > >> >> I think you just have a problem with order of operations in the query, > > >> >> try > > >> >> > > >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > > >> >> > SALES_METHOD, > > >> >> > CONTRACT_LENGTH, CARRIER_CODE > > >> >> > FROM IRUS_INVOICES > > >> >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > >> >> > @orderMonth) > > >> >> > AND ((BILL_TYPE = @billType) OR (@billType IS NULL)) > > >> >> > > >> >> I hope that helps! > > >> >> Chris > > >> >> > > >> >> > > >> >> "pmud" <pmud@discussions.microsoft.com> wrote in message > > >> >> news:02084543-D4F8-45A2-8E43-6A792105FADA@microsoft.com... > > >> >> > Hi Robert, > > >> >> > > > >> >> > I tried =Nothing , it didnt work. My problem is that I have a report > > >> >> > with > > >> >> > a > > >> >> > matrix with a row and column called Carrier and Month respectively. > > >> >> > This > > >> >> > report has around 10 parameters and allows the users to view the > > >> >> > report > > >> >> > based > > >> >> > on one or all of the parameters of this report. Now when the data > > >> >> > cell > > >> >> > of > > >> >> > the matrix is clicked, it jumps to the subreport. > > >> >> > > > >> >> > Now the problem is that when the user doesnt select any of the > > >> >> > parameters > > >> >> > & > > >> >> > ets thier value remain as null ( so that they show data for all > > >> >> > ratger > > >> >> > than a > > >> >> > specific parameter) , then when it jumps to the details report, the > > >> >> > report > > >> >> > doesnt show up 'coz the paramater is sghown as blank. What I want > > >> >> > is, > > >> >> > that > > >> >> > if > > >> >> > the user selects NULL, for any or all parametres, then in the sub > > >> >> > report, > > >> >> > it > > >> >> > should atuomatically take that parameter to show all values. How can > > >> >> > this > > >> >> > be > > >> >> > done? Below is the sample query I use in my details report: > > >> >> > > > >> >> > SELECT ORDER_NO, ORDER_DATE, BILL_TYPE, PORT_REQUIRED, > > >> >> > SALES_METHOD, > > >> >> > CONTRACT_LENGTH, CARRIER_CODE > > >> >> > FROM IRUS_INVOICES > > >> >> > WHERE (CARRIER_CODE = @carrier) AND (MONTH(ORDER_DATE) = > > >> >> > @orderMonth) > > >> >> > AND (BILL_TYPE = @billType) OR > > >> >> > (CARRIER_CODE = @carrier) AND > > >> >> > (MONTH(ORDER_DATE) = > > >> >> > @orderMonth) AND (@billType IS NULL) > > >> >> > > > >> >> > Here the parameter Bill_Type is passed from the main matrix report. > > >> >> > But > > >> >> > if > > >> >> > the user chooses Null as the parameter in the main report, then this > > >> >> > details > > >> >> > report, doesnt show any data . When I check the box next to > > >> >> > Bill_Type > > >> >> > ( in > > >> >> > details repotr), then it shows data. How can I modify my query so > > >> >> > that > > >> >> > if > > >> >> > user just selects null for any or all parameters in main report, > > >> >> > then > > >> >> > the > > >> >> > details report automatically shows the data with that parameter as > > >> >> > null
Don't see what you're looking for? Try a search.
|