Hi
My requirement is to display names all the months between two dates
from the table.
I have lots of START and STOP dates available in my table and I need
to display names of all the months including Start and Stop months.
How can I do that, with function or with some loop.
My database is SQL Server 2000 .
ThanksSee the DATENAME() function and SELECT DISTINCT.
Edmund
<akpatelrs@.googlemail.com> wrote in message
news:1149518723.100427.10020@.f6g2000cwb.googlegroups.com...
> Hi
> My requirement is to display names all the months between two dates
> from the table.
> I have lots of START and STOP dates available in my table and I need
> to display names of all the months including Start and Stop months.
> How can I do that, with function or with some loop.
> My database is SQL Server 2000 .
> Thanks
>|||Edmund,
Here is a way to display the month names between @.start and @.stop
for two variables. You should be able to adapt this to your needs.
It requires a table containing the integers from 0 on up.
declare @.start datetime set @.start = '20050323'
declare @.stop datetime set @.stop = '20070223'
select
datename(month,dateadd(month,datediff(mo
nth,0,@.start)+n,0)) as MonthName
from Numbers1000
where n <= datediff(month,@.start,@.stop)
order by n
Here's how to generate the table of 1000 integers (you probably don't
need more)
create table Numbers1000(
n int primary key
)
declare @.a int set @.a = 0
while @.a < 1000 begin
insert into Numbers1000 values (@.a)
set @.a = @.a + 1
end
Steve Kass
Drew University
Edmund wrote:
>See the DATENAME() function and SELECT DISTINCT.
>Edmund
><akpatelrs@.googlemail.com> wrote in message
>news:1149518723.100427.10020@.f6g2000cwb.googlegroups.com...
>
>
>|||Try this
declare @.date1 datetime,@.date2 datetime,@.str varchar(1000)
set @.str=''
set @.date1 = dateadd(mm,-4,getdate()) /* set it as yr start date */
set @.date2 = dateadd(mm,10,getdate()) /* set it as yr end date */
while datediff(mm,@.date1,@.date2)>0
begin
-- display month
set @.str= @.str+datename(mm,@.date1)+', '
-- decrease date
set @.date1 = dateadd(mm,1,@.date1)
end
declare @.strlen int
set @.strlen = len(@.str)
if @.strlen>1
select left(@.str,len(@.str)-2) as month_name
else
select @.str
hth
Peter
<akpatelrs@.googlemail.com> wrote in message
news:1149518723.100427.10020@.f6g2000cwb.googlegroups.com...
> Hi
> My requirement is to display names all the months between two dates
> from the table.
> I have lots of START and STOP dates available in my table and I need
> to display names of all the months including Start and Stop months.
> How can I do that, with function or with some loop.
> My database is SQL Server 2000 .
> Thanks
>|||akpatelrs@.googlemail.com wrote:
> Hi
> My requirement is to display names all the months between two dates
> from the table.
> I have lots of START and STOP dates available in my table and I need
> to display names of all the months including Start and Stop months.
> How can I do that, with function or with some loop.
> My database is SQL Server 2000 .
> Thanks
Here is data from my table. For instance, for first start n stop date,
i need to display JAN,FEB like wise for second MAR,APR,MAY . This way
for all Start and Stop date from the table.
StartDate
StopDate
2007-01-01 00:00:00.000 2007-02-17
00:00:00.000
2006-03-01 13:38:46.397 2006-05-01
13:38:46.397
2006-05-19 03:18:57.060 2006-05-19
03:18:57.060|||You have a few suggestions already. Let me put my weight behind Steve's use
of an auxiliary table of numbers. There are all kinds of uses for it, it
doesn't take up much space, and it's ideal for situations like that which
you've got into. Populate it once, and then forget it's there. Just make
sure it's large enough - there may be times when you want it to be larger
than 1000. It's easy to top-up of course, but you don't want to find that
you discover it's too small when a client's report comes out short.
Rob
<akpatelrs@.googlemail.com> wrote in message
news:1149518723.100427.10020@.f6g2000cwb.googlegroups.com...
> Hi
> My requirement is to display names all the months between two dates
> from the table.
> I have lots of START and STOP dates available in my table and I need
> to display names of all the months including Start and Stop months.
> How can I do that, with function or with some loop.
> My database is SQL Server 2000 .
> Thanks
>
Showing posts with label available. Show all posts
Showing posts with label available. Show all posts
Wednesday, March 21, 2012
Friday, March 9, 2012
I need to know how to deploy reports without Visual Studio
I have reviewed the available documentation and was unable to locate a
method to deploy reports outside of Visual Studio without instantiating
the web service. We have a package we would like to bundle with some
reports.
Does anyone know an easy way to deploy reports using an .rdl file?The only way to deploy reports is through the web service. (VS uses the web
service) Look for the method CreateReport. You can always use rs.exe and
create a simple script to do the deployment.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kelly Gross" <kgross@.htp-inc.com> wrote in message
news:1103233970.824910.306870@.f14g2000cwb.googlegroups.com...
>I have reviewed the available documentation and was unable to locate a
> method to deploy reports outside of Visual Studio without instantiating
> the web service. We have a package we would like to bundle with some
> reports.
> Does anyone know an easy way to deploy reports using an .rdl file?
>|||The rs utility requires administrator permission on the target machine.
We are using an msi install which runs in the context of the local
system account. Do we have sufficient permission to run the rs utility?|||Non admins can run rs, but there is an issue on W2k that prevents this. XP
and W2k should be fine. However the local system account is an admin so you
should not see this issue (although I have not tried it and can't be 100%
sure). The problem is not a permission issue, but something with the
framework.
The user will need permission within RS. As long as local admins have
permission to publish to RS then you should have no issues.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kelly Gross" <kgross@.htp-inc.com> wrote in message
news:1103235966.097594.118890@.f14g2000cwb.googlegroups.com...
> The rs utility requires administrator permission on the target machine.
> We are using an msi install which runs in the context of the local
> system account. Do we have sufficient permission to run the rs utility?
>|||Why not use the upload file buttom of the Report Manager
(http://yourreportsite/reports) to do the deployment?
a) Upload the rdl;
b) Create the db connection manually again within the Report Manager.
Tao
"Daniel Reib [MSFT]" wrote:
> Non admins can run rs, but there is an issue on W2k that prevents this. XP
> and W2k should be fine. However the local system account is an admin so you
> should not see this issue (although I have not tried it and can't be 100%
> sure). The problem is not a permission issue, but something with the
> framework.
> The user will need permission within RS. As long as local admins have
> permission to publish to RS then you should have no issues.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Kelly Gross" <kgross@.htp-inc.com> wrote in message
> news:1103235966.097594.118890@.f14g2000cwb.googlegroups.com...
> > The rs utility requires administrator permission on the target machine.
> > We are using an msi install which runs in the context of the local
> > system account. Do we have sufficient permission to run the rs utility?
> >
>
>
method to deploy reports outside of Visual Studio without instantiating
the web service. We have a package we would like to bundle with some
reports.
Does anyone know an easy way to deploy reports using an .rdl file?The only way to deploy reports is through the web service. (VS uses the web
service) Look for the method CreateReport. You can always use rs.exe and
create a simple script to do the deployment.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kelly Gross" <kgross@.htp-inc.com> wrote in message
news:1103233970.824910.306870@.f14g2000cwb.googlegroups.com...
>I have reviewed the available documentation and was unable to locate a
> method to deploy reports outside of Visual Studio without instantiating
> the web service. We have a package we would like to bundle with some
> reports.
> Does anyone know an easy way to deploy reports using an .rdl file?
>|||The rs utility requires administrator permission on the target machine.
We are using an msi install which runs in the context of the local
system account. Do we have sufficient permission to run the rs utility?|||Non admins can run rs, but there is an issue on W2k that prevents this. XP
and W2k should be fine. However the local system account is an admin so you
should not see this issue (although I have not tried it and can't be 100%
sure). The problem is not a permission issue, but something with the
framework.
The user will need permission within RS. As long as local admins have
permission to publish to RS then you should have no issues.
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Kelly Gross" <kgross@.htp-inc.com> wrote in message
news:1103235966.097594.118890@.f14g2000cwb.googlegroups.com...
> The rs utility requires administrator permission on the target machine.
> We are using an msi install which runs in the context of the local
> system account. Do we have sufficient permission to run the rs utility?
>|||Why not use the upload file buttom of the Report Manager
(http://yourreportsite/reports) to do the deployment?
a) Upload the rdl;
b) Create the db connection manually again within the Report Manager.
Tao
"Daniel Reib [MSFT]" wrote:
> Non admins can run rs, but there is an issue on W2k that prevents this. XP
> and W2k should be fine. However the local system account is an admin so you
> should not see this issue (although I have not tried it and can't be 100%
> sure). The problem is not a permission issue, but something with the
> framework.
> The user will need permission within RS. As long as local admins have
> permission to publish to RS then you should have no issues.
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Kelly Gross" <kgross@.htp-inc.com> wrote in message
> news:1103235966.097594.118890@.f14g2000cwb.googlegroups.com...
> > The rs utility requires administrator permission on the target machine.
> > We are using an msi install which runs in the context of the local
> > system account. Do we have sufficient permission to run the rs utility?
> >
>
>
Subscribe to:
Posts (Atom)