Showing posts with label rest. Show all posts
Showing posts with label rest. Show all posts

Sunday, March 25, 2012

Distinct question

Hi
Ive got a problem with the Distinct function
I need to only select one column with the distinct function and leave the
rest so they can have duplicates.
For exampel
Table_Orders
OrderID | Orderdate | User | City
Then I want to select the unique OrderID to list all current orders but at
the same time i want the users and the orderdates no to be unique. so i want
the distinct function to work only on the OrderID column.
Is that possible ?
/GustafThis has been responded to in the .programming newsgroup.
Please do not multi-post.
Thanks!
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Gurra" <gurgel@.telia.com> wrote in message
news:umLGpRPnDHA.360@.TK2MSFTNGP12.phx.gbl...
> Hi
> Ive got a problem with the Distinct function
> I need to only select one column with the distinct function and leave the
> rest so they can have duplicates.
> For exampel
> Table_Orders
> OrderID | Orderdate | User | City
> Then I want to select the unique OrderID to list all current orders but at
> the same time i want the users and the orderdates no to be unique. so i
want
> the distinct function to work only on the OrderID column.
> Is that possible ?
> /Gustaf
>
>

Sunday, March 11, 2012

Displaying only a fixed number of Columns in Matrix

Is it possible to display only a certain number of columns in a matrix, say the first 6 and then hide the rest? That is, does the matrix allow to somehow control how many columns can be displayed from a column group and hide the remaining columns (I need this to limit the number of columns a user is able to see so that the matrix width does not get infinitely long).

In other words.....

I need to display the subtotals for all dynamically generated columns but display only first 6 columns. This way I can avoid having to display 50 columns and not have user scroll to so far right and keep the page width within reasonable limits. Hope I have made it clear.

Thanks.

I did something like this. If you know that 6 columns will fill the width then you can return the (total amount of known columns / 6) as a page count.

Use the page count variable to hide/unhide a set of labels on top of the report. When a page label is clicked call the same report with the selected page as a parameter.

This will work if you can segment the result set based on a your page range in the database.

|||

Hmmm... That may not be exactly what I am looking for. Ideally, it would be nice if one can go into Group->Edit Column Group and set some property such as "# of Columns to Display for this Column Group" and behind the scenes it didn't care whether or not you bring in 6 columns from the DB or 600.

I hope there is a simpler solution or workaround to this.

|||Any body plz.. any ideas how to achieve this either in sql or through matrix formatting?

Displaying only a fixed number for Columns in Matrix

Is it possible to display only a certain number of columns in a matrix, say the first 6 and then hide the rest? That is, does the matrix allow to somehow control how many columns can be displayed from a column group and hide the remaining columns (I need this to limit the number of columns a user is able to see so that the matrix width does not get infinitely long).

In other words.....

I need to display the subtotals for all dynamically generated columns but display only first 6 columns. This way I can avoid having to display 50 columns and not have user scroll to so far right and keep the page width within reasonable limits. Hope I have made it clear.

Thanks.

I did something like this. If you know that 6 columns will fill the width then you can return the (total amount of known columns / 6) as a page count.

Use the page count variable to hide/unhide a set of labels on top of the report. When a page label is clicked call the same report with the selected page as a parameter.

This will work if you can segment the result set based on a your page range in the database.

|||

Hmmm... That may not be exactly what I am looking for. Ideally, it would be nice if one can go into Group->Edit Column Group and set some property such as "# of Columns to Display for this Column Group" and behind the scenes it didn't care whether or not you bring in 6 columns from the DB or 600.

I hope there is a simpler solution or workaround to this.

|||Any body plz.. any ideas how to achieve this either in sql or through matrix formatting?