Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
i have a dropdown as parameter in my report which contain 3 values: value1 value2 and none. on clicking on value1 i want another parameter to appear as below:
enter image description here
If i click on none then nothing should display. Is it possible to achieve this by using filter/dataset? i am not sure how to do it. Any help will be really appreciated. Thanks
You cannot change the names or captions of the parameter drop down control at run time. So you cannot have the second parameter labelled as 'Value 1' if 'Value 1 was selected in your first parameter.
You can however, control what is shown in your second parameter and have the list of items be dependent on your first parameter value.
For example, lets say we had a table called products that contained the following..
ProdID
Category
Colour
Location
1
Bike
Red
A
2
Bike
Blue
A
3
Bike
Green
A
4
Car
Red
A
5
Car
Red
B
6
Car
Blue
B
7
Boat
Red
A
8
Boat
White
A
9
Boat
Blue
A
If your first parameter was called p1 had the following value, caption pairs
1 = Category
2 = Colour
3 = Location
Then the dataset query for the seconds parameter would be something like
SELECT DISTINCT
CASE #p1
WHEN 1 THEN [Category]
WHEN 2 THEN [Colour]
WHEN 3 THEN [Location]
END as pValues
FROM [products]
ORDER BY 1;
If this does not help, please edit your question and explain exactly what you are trying to achieve.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
There is a TEXT_TRANS table which contains the translation of a specific word and they contain same textid but different languageid. Suppose there is a row in TEXT_TRANS table for the Name column 'Mohan' which has a specific textid and languageid . For Ukrainian language there will be another row for Name column 'мохан' which will have same textid as of english but different languageid. So I have inserted one row for Ukrainian language but forgot to put N before ukrainian word because it will show ?????. Then I updated correctly by putting N before the ukrainian word. However, The field is still showing as ?????? even when I deleted that row for Ukrainian language.
To store and select Unicode character in database you have to use NVARCHAR instead of VARCHAR. You need to be sure that column has correct datatype.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have created a project in C#. In my database I have a table "Users" in which there is a field "City". Now I want to put some query that returns all the cities and how many users belongs to that city. For example there are 9 users in that table and 3 users live in New York, 3 in Chicago and 3 in Washington so the output should be:
City- New York, Records- 3
etc.
Thanks.
Group by city and then get the count of cities.
select City, count(City) as Records
from Users
group by City
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
Working on a search page. My search results are working but I also need to provide filter choices. One of these choices are a set of price quadrants with product counts. So basically in the result set I have to grab the lowest price and the highest price, then equally break it into 4 groupings and then return those groupings with product counts for each.
So we returned back 49 products, the lowest priced product was $10 and the highest priced products was $110. I have to re-calculate this for every set of search results we're filtering so I can't hard code the floor and ceiling values.
So it would look like this with the number in parenthesis being the number of returned products with a value falling inside that quadrant.
$10.00 to $35.00 (2)
$35.01 to $60.00 (12)
$60.01 to $85.00 (0)
$85.01 to $110.00 (35)
I'm trying to do this in a single SELECT statement because we want to run it off the search results temporary table if the user asks for it.
I keep hitting brick walls trying to write this and can't seem to get very far.
I couldn't get it to work in a single statement, but I was able to get it to work. We created a Numbers table called [Numbers] that I'm using...
DECLARE #priceFloor money; DECLARE #priceCeiling money; DECLARE #priceRange int;
SELECT #PriceFloor = FLOOR(MIN(price)) , #PriceCeiling = CEILING(Max(price)),
#PriceRange = CEILING(Max(price))/4
FROM #TempSearchResults;
WITH priceFilterCTE AS
(
SELECT Number * #PriceRange AS FromPrice, (Number * #PriceRange) + #PriceRange -.01 AS ToPrice
FROM Numbers
WHERE Number BETWEEN 0 AND 3
)
SELECT CAST(FromPrice AS VARCHAR(20)) + ' to ' + CAST(ToPrice AS VARCHAR(20)) AS Price,
(
SELECT COUNT(1)
FROM #TempSearchResults
WHERE price BETWEEN priceFilterCTE.FromPrice AND priceFilterCTE.ToPrice
) AS [COUNT]
FROM priceFilterCTE
Return looks like....
PRICE COUNT
0 to 798.99 949
799 to 1597.99 162
1598 to 2396.99 32
2397 to 3195.99 7
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I asked this question before and someone vote down myquestion saying that this question is not valid. I have spent three days on this problem. So please if you do not understand it , it does not mean that the question is invalid. Here it is:
I have created a SSRS report. I am facing problem with respect to page break and Grouping.
Here is the out put of my report.
On each page I want to show record group by Landing Date and Buyer Name.
That is on first page following should be shown:
Buyer Name Landing Date Actual Price
SHETLAND 06-Jan-05 100989.754569257
On second page:
Buyer Name Landing Date Actual Price
SHETLAND 11-Jan-05 1096677.95045137
On third page:
Buyer Name Landing Date Actual Price
FRESH 14-Jan-05 300080.972657965
SHETLAND 14-Jan-05 157372.157557842
==========================================================================
I applied Grouping using group properties , but no effect. Basically I want to show records with same landing date on one page.
Try to create Grouping on two level (nested). That is first group by Landing Date and then right click on newly created group and create a child group . and in child group create expression to group by Buyer Name. Hope it will work.
You need to add a row group with the group by on Landing Date and Buyer name, and then in the group properties tick the check box for 'Add a page break between instances of a group'
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Again I m sry fr that non-sense way of asking the question what i wanted to say that at the last column some rows have null values and some rows have a value which is not necessary.. So what i wanted to do to delete those rows which have not null values in last column and then deleting the whole last column...
The Table looks like this..:
Col1 Col2 Col3 Col4
A A A A
B B B
C C C
D D D D
So here i want to keep the row 2 and 3 and delete the row 1 and 4..Then deleting the whole column 4...
My answer is based on your comment:
Oopss!!! i am extremely sorry fr making a mess..:( what i wanted to
say that at the last column some rows have null values and some rows
have a value which is not necessary.. So what i wanted to do to delete
those rows which have not null values in last column and then deleting
the whole last column..
Here it is:
Delete from dbo.YourTable Where Last_Column IS NOT NULL
After that, dropping the column is easy if you go to table right click -> design
If it doesn't let you drop the column due to an error, you should do this:
Tools -> Options -> Designers-> Uncheck "Prevent saving changes that require table re-creation"
I'd suggest that you undo that change after you're done though.
Best of luck =)
What you're trying to do won't work because they'll all have the same number of columns.
So don't waste your time trying to implement it because it won't solve whatever problem you're trying to solve!
DELETE dbo.table WHERE Col4 IS NOT NULL;