Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Wednesday, March 28, 2012

Linking Datasets

How can you link two datasets on a report that come from different databases.
I tried to create a queried parameter that pulls its value from a dataset1
field and use in the where clause of my dataset2 query. It gets an error
message indicating you cannot have a forward looking parameter. Any help for
this newbie is greatly appreciated.You should look at using subreports.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"rdavis104" <rdavis104@.discussions.microsoft.com> wrote in message
news:5F433F07-C1A9-4B7F-8689-890A5476D8C1@.microsoft.com...
> How can you link two datasets on a report that come from different
> databases.
> I tried to create a queried parameter that pulls its value from a dataset1
> field and use in the where clause of my dataset2 query. It gets an error
> message indicating you cannot have a forward looking parameter. Any help
> for
> this newbie is greatly appreciated.|||Subreports worked great, very easy to setup.
Thanks
"Bruce L-C [MVP]" wrote:
> You should look at using subreports.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "rdavis104" <rdavis104@.discussions.microsoft.com> wrote in message
> news:5F433F07-C1A9-4B7F-8689-890A5476D8C1@.microsoft.com...
> > How can you link two datasets on a report that come from different
> > databases.
> > I tried to create a queried parameter that pulls its value from a dataset1
> > field and use in the where clause of my dataset2 query. It gets an error
> > message indicating you cannot have a forward looking parameter. Any help
> > for
> > this newbie is greatly appreciated.
>
>|||I ran across another snag. When I export the main report (with subreports)
to Excel the cells that should contain the subreport data have "Subreports
within table/matrix cells are ignored" as a value. Not sure if I missed
something or if I am doing something wrong. This report will need to output
to Excel format. Thanks in advance for the help.
"rdavis104" wrote:
> Subreports worked great, very easy to setup.
> Thanks
> "Bruce L-C [MVP]" wrote:
> > You should look at using subreports.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "rdavis104" <rdavis104@.discussions.microsoft.com> wrote in message
> > news:5F433F07-C1A9-4B7F-8689-890A5476D8C1@.microsoft.com...
> > > How can you link two datasets on a report that come from different
> > > databases.
> > > I tried to create a queried parameter that pulls its value from a dataset1
> > > field and use in the where clause of my dataset2 query. It gets an error
> > > message indicating you cannot have a forward looking parameter. Any help
> > > for
> > > this newbie is greatly appreciated.
> >
> >
> >sql

Linking a number with a month name

Hi,
I have a table with a field called Period whcih has numbers from 1 - 12. Now
I want to say that if the value of the field is 1 , then the report should
display january, if its 2 , Feburary and so on... Is there a way this can be
done without having to create a table ?
--
pmudYou can change your query to add column for month name
Oracle =Monthname(Extract Month from tempdate)
SQL server=DayPart("m",tempdate)
hope it helps.
"pmud" wrote:
> Hi,
> I have a table with a field called Period whcih has numbers from 1 - 12. Now
> I want to say that if the value of the field is 1 , then the report should
> display january, if its 2 , Feburary and so on... Is there a way this can be
> done without having to create a table ?
> --
> pmud|||Go to the Code tab of the Reports Properties dialog and add the following:
function MonthValue(byval MonthInt as integer) as string
select case MonthInt
case 1
return "Jan"
case 2
return "Feb"
'...
case else
return "Bad Month"
End select
end function
Then in the text box where you want the month to display place this
expression:
=Code.MonthValue( Fields!Period.Value)
You can read more about adding code by searching the help for 'Writing
Custom Code'
"pmud" wrote:
> Hi,
> I have a table with a field called Period whcih has numbers from 1 - 12. Now
> I want to say that if the value of the field is 1 , then the report should
> display january, if its 2 , Feburary and so on... Is there a way this can be
> done without having to create a table ?
> --
> pmud|||Hi Harolds,
That was very helpful.
Thanks
--
pmud
"Harolds" wrote:
> Go to the Code tab of the Reports Properties dialog and add the following:
> function MonthValue(byval MonthInt as integer) as string
> select case MonthInt
> case 1
> return "Jan"
> case 2
> return "Feb"
> '...
> case else
> return "Bad Month"
> End select
> end function
> Then in the text box where you want the month to display place this
> expression:
> =Code.MonthValue( Fields!Period.Value)
> You can read more about adding code by searching the help for 'Writing
> Custom Code'
> "pmud" wrote:
> > Hi,
> >
> > I have a table with a field called Period whcih has numbers from 1 - 12. Now
> > I want to say that if the value of the field is 1 , then the report should
> > display january, if its 2 , Feburary and so on... Is there a way this can be
> > done without having to create a table ?
> > --
> > pmud|||Thanks Guys, this helped me out as well
"pmud" wrote:
> Hi Harolds,
> That was very helpful.
> Thanks
> --
> pmud
>
> "Harolds" wrote:
> > Go to the Code tab of the Reports Properties dialog and add the following:
> >
> > function MonthValue(byval MonthInt as integer) as string
> > select case MonthInt
> > case 1
> > return "Jan"
> > case 2
> > return "Feb"
> > '...
> > case else
> > return "Bad Month"
> > End select
> > end function
> >
> > Then in the text box where you want the month to display place this
> > expression:
> >
> > =Code.MonthValue( Fields!Period.Value)
> >
> > You can read more about adding code by searching the help for 'Writing
> > Custom Code'
> >
> > "pmud" wrote:
> >
> > > Hi,
> > >
> > > I have a table with a field called Period whcih has numbers from 1 - 12. Now
> > > I want to say that if the value of the field is 1 , then the report should
> > > display january, if its 2 , Feburary and so on... Is there a way this can be
> > > done without having to create a table ?
> > > --
> > > pmud|||There is an easier way in the cell itself. There is a VB.net function
MonthName(), so
=MonthName(Month(Fields!MyDate.Value), True)
will give "Jan", "Feb" etc. Change the True to False and you'll get
full month names. I also think it is language aware, so will return the
month in the language the client system is set to.
--
Regards
Chris
Stephen L wrote:
> Thanks Guys, this helped me out as well
> "pmud" wrote:
> > Hi Harolds,
> >
> > That was very helpful.
> >
> > Thanks
> > --
> > pmud
> >
> >
> > "Harolds" wrote:
> >
> > > Go to the Code tab of the Reports Properties dialog and add the
> > > following:
> > >
> > > function MonthValue(byval MonthInt as integer) as string
> > > select case MonthInt
> > > case 1
> > > return "Jan"
> > > case 2
> > > return "Feb"
> > > '...
> > > case else
> > > return "Bad Month"
> > > End select
> > > end function
> > >
> > > Then in the text box where you want the month to display place
> > > this expression:
> > >
> > > =Code.MonthValue( Fields!Period.Value)
> > >
> > > You can read more about adding code by searching the help for
> > > 'Writing Custom Code'
> > >
> > > "pmud" wrote:
> > >
> > > > Hi,
> > > >
> > > > I have a table with a field called Period whcih has numbers
> > > > from 1 - 12. Now I want to say that if the value of the field
> > > > is 1 , then the report should display january, if its 2 ,
> > > > Feburary and so on... Is there a way this can be done without
> > > > having to create a table ?
> > > > --
> > > > pmud