Showing posts with label names. Show all posts
Showing posts with label names. Show all posts

Wednesday, March 28, 2012

how to show the month name?

I am using

selectmonth(date_field)

to display the month but it's showing the month number and I want to show as names, e.g. Jan, Feb, Mar. etc..

|||

Jassim:

Lookup the DATENAME function in books online; it should be something like:

select datename (mm, date_field)

Or if you want to only show the first three letters of the month:

select left(datename (mm, date_field), 3)

|||Select Convert(Varchar(3),Datename(mm,getdate()))

how to show the month name?

I am using

selectmonth(date_field)

to display the month but it's showing the month number and I want to show as names, e.g. Jan, Feb, Mar. etc..

|||

Jassim:

Lookup the DATENAME function in books online; it should be something like:

select datename (mm, date_field)

Or if you want to only show the first three letters of the month:

select left(datename (mm, date_field), 3)

|||Select Convert(Varchar(3),Datename(mm,getdate()))

Monday, March 26, 2012

How to show all the fields in a dataset.

I have a sp that returns a different dataset depending on the parameter
values, it is dyanamic sp which has different field names and also the
number of fields.
Is there a way to incorporate this in reporting services, like in .Net
we can display the dataset by just binding it to the datagrid and
letting datagrid handle the rest.
Thanks,
TonyNo. RS does not work that way. It expects a consistent number/name of
fields.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<bubaa118@.yahoo.com> wrote in message
news:1107965810.679249.274270@.c13g2000cwb.googlegroups.com...
> I have a sp that returns a different dataset depending on the parameter
> values, it is dyanamic sp which has different field names and also the
> number of fields.
> Is there a way to incorporate this in reporting services, like in .Net
> we can display the dataset by just binding it to the datagrid and
> letting datagrid handle the rest.
> Thanks,
> Tony
>|||Thanks for the prompt reply Bruce, Is there any other workaround for
the issue I have any ideas or suggestions would be great.
Thanks again,
Tony|||You can have multiple datasets in a report, each of them calling the
procedure with the appropriate parameter. This does mean the SP will get
called multiple times. Then you should be able to hide the table on the
report if there is no data. I haven't tried this but I think you can. You
still might end up with some blank lines though.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<bubaa118@.yahoo.com> wrote in message
news:1107967055.899883.298640@.f14g2000cwb.googlegroups.com...
> Thanks for the prompt reply Bruce, Is there any other workaround for
> the issue I have any ideas or suggestions would be great.
> Thanks again,
> Tony
>|||You could also at the end of your proc pivot (or is this really
unpivoting) the data. So for a table with structure
# keycol # col1 # col2 # col3 # col4 # ... # col<n> #
you would end up with
# keycolvalue # colname # colvalue #
this will have n rows for each row in the original table. You may want
to modify your proc to build that to begin with rather than pivot data
later.
then you could drop that into a matrix.
This would work fairly well if all variable columns are of the same
type. Otherwise you'd have to do some formatting in the stored
procedure.

How to show all field names and data in two columns i.e. Pivot / c

What we would like to do is to pivot a table with 300 columns into one that
is just two columns. The first column containing the field name and the
second column containing the value of that column.
This also includes a where clause to filter the recordset. e.g where id =
'123'
Hi
I think you are actually looking to UNPIVOT the data such as
http://www.umachandar.com/technical/...pts/Main25.htm
You will probably be better doing this client side.
John
"Smartbiz" <Smartbiz@.discussions.microsoft.com> wrote in message
news:35458430-363D-42C7-B3C0-879EE294ED1B@.microsoft.com...
> What we would like to do is to pivot a table with 300 columns into one
> that
> is just two columns. The first column containing the field name and the
> second column containing the value of that column.
> This also includes a where clause to filter the recordset. e.g where id =
> '123'
sql

How to show all field names and data in two columns i.e. Pivot / c

What we would like to do is to pivot a table with 300 columns into one that
is just two columns. The first column containing the field name and the
second column containing the value of that column.
This also includes a where clause to filter the recordset. e.g where id =
'123'Hi
I think you are actually looking to UNPIVOT the data such as
http://www.umachandar.com/technical...ipts/Main25.htm
You will probably be better doing this client side.
John
"Smartbiz" <Smartbiz@.discussions.microsoft.com> wrote in message
news:35458430-363D-42C7-B3C0-879EE294ED1B@.microsoft.com...
> What we would like to do is to pivot a table with 300 columns into one
> that
> is just two columns. The first column containing the field name and the
> second column containing the value of that column.
> This also includes a where clause to filter the recordset. e.g where id =
> '123'

How to show all field names and data in two columns i.e. Pivot / c

What we would like to do is to pivot a table with 300 columns into one that
is just two columns. The first column containing the field name and the
second column containing the value of that column.
This also includes a where clause to filter the recordset. e.g where id = '123'Hi
I think you are actually looking to UNPIVOT the data such as
http://www.umachandar.com/technical/SQL6x70Scripts/Main25.htm
You will probably be better doing this client side.
John
"Smartbiz" <Smartbiz@.discussions.microsoft.com> wrote in message
news:35458430-363D-42C7-B3C0-879EE294ED1B@.microsoft.com...
> What we would like to do is to pivot a table with 300 columns into one
> that
> is just two columns. The first column containing the field name and the
> second column containing the value of that column.
> This also includes a where clause to filter the recordset. e.g where id => '123'

How to show a line between table column headers and the details

I am using table object to present report.

table row1 has all the column names and table row2 has the data.

How can i put a horizontal line between column names and the data rows.

Thank you very much.

Would adding a solid border to the bottom of the row having the column headers in it work?

Jarret