Showing posts with label written. Show all posts
Showing posts with label written. Show all posts

Tuesday, March 20, 2012

Pulling RS Report into online application

I've got an online application (written in Cold Fusion) that I would like to
be able to pull in a report generated in RS. Currently, I can call the
report directly from the application using an HTTP "get", pass in the url
string with "rs:Format=PDF", save the resulting PDF file on my server, then
render that PDF file in my cold fusion application.
What I would LIKE to do is render the report in HTML format in my
application. The problem is, the report has a couple of graphs in it, and
the resulting HTML that is generated does not know where to find the graph
images.
Is there anyway to capture the resulting HTML that is generated from the
Report Server in such a way that it can be run in another online web
application (running on the same server as the RS), and yet be able to
correctly fetch the generated graphical images?
I hope this makes sense.
TIA,
BrianYour cold fusion app should be the same as viewing the report directly in
the browser itself unless I'm mistaken. Where does it think the graphic
images are? RS puts the img src to be the GUID of the image from the Report
Server. I'm just wondering where your web page thinks the image exists.
Tom
This posting is provided "AS IS" with no warranties, and confers no rights.
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
> I've got an online application (written in Cold Fusion) that I would like
to
> be able to pull in a report generated in RS. Currently, I can call the
> report directly from the application using an HTTP "get", pass in the url
> string with "rs:Format=PDF", save the resulting PDF file on my server,
then
> render that PDF file in my cold fusion application.
> What I would LIKE to do is render the report in HTML format in my
> application. The problem is, the report has a couple of graphs in it, and
> the resulting HTML that is generated does not know where to find the graph
> images.
> Is there anyway to capture the resulting HTML that is generated from the
> Report Server in such a way that it can be run in another online web
> application (running on the same server as the RS), and yet be able to
> correctly fetch the generated graphical images?
> I hope this makes sense.
> TIA,
> Brian
>|||Thanks for your response Tom.
Using the <CFHTTP> "get", i'm able to capture the HTML generated for the
report by the RS. Embedded in the HTML is the following <img> tag which is
trying to load the graph:
<IMG
SRC="pathToReportServer?/pathToReport&Year=2004&rs:Format=HTML3.2&rs:ImageID
=C_4_S&rs:ChartImg="/>
When my application calls the HTML page, it is unable to load this image.
This is kind of a strange situation because i'm trying to load the graphical
image that the RS generated when i initially called the report a few seconds
ago using CFHTTP. The problem is, that report was called with certain
parameters causing that particular instance of the report to be generated
with that particular instance of the graph.
What I'm trying to do here might not be possible.
Brian
"Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
news:ubA4CB4XEHA.1128@.TK2MSFTNGP10.phx.gbl...
> Your cold fusion app should be the same as viewing the report directly in
> the browser itself unless I'm mistaken. Where does it think the graphic
> images are? RS puts the img src to be the GUID of the image from the
Report
> Server. I'm just wondering where your web page thinks the image exists.
> Tom
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "G" <brian.grant@.si-intl-kc.com> wrote in message
> news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
> > I've got an online application (written in Cold Fusion) that I would
like
> to
> > be able to pull in a report generated in RS. Currently, I can call the
> > report directly from the application using an HTTP "get", pass in the
url
> > string with "rs:Format=PDF", save the resulting PDF file on my server,
> then
> > render that PDF file in my cold fusion application.
> >
> > What I would LIKE to do is render the report in HTML format in my
> > application. The problem is, the report has a couple of graphs in it,
and
> > the resulting HTML that is generated does not know where to find the
graph
> > images.
> >
> > Is there anyway to capture the resulting HTML that is generated from the
> > Report Server in such a way that it can be run in another online web
> > application (running on the same server as the RS), and yet be able to
> > correctly fetch the generated graphical images?
> >
> > I hope this makes sense.
> >
> > TIA,
> >
> > Brian
> >
> >
>|||I don't know that much about CF so as you say, it may not be possible since
it may be a level of indirection that CF applies to the get. One other
option that you could possibly do is create an IFRAME in your CF app that
links directly to your report via the URL.
Tom
This posting is provided "AS IS" with no warranties, and confers no rights.
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:O0EWee4XEHA.2868@.TK2MSFTNGP09.phx.gbl...
> Thanks for your response Tom.
> Using the <CFHTTP> "get", i'm able to capture the HTML generated for the
> report by the RS. Embedded in the HTML is the following <img> tag which is
> trying to load the graph:
> <IMG
>
SRC="pathToReportServer?/pathToReport&Year=2004&rs:Format=HTML3.2&rs:ImageID
> =C_4_S&rs:ChartImg="/>
> When my application calls the HTML page, it is unable to load this image.
> This is kind of a strange situation because i'm trying to load the
graphical
> image that the RS generated when i initially called the report a few
seconds
> ago using CFHTTP. The problem is, that report was called with certain
> parameters causing that particular instance of the report to be generated
> with that particular instance of the graph.
> What I'm trying to do here might not be possible.
> Brian
> "Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
> news:ubA4CB4XEHA.1128@.TK2MSFTNGP10.phx.gbl...
> > Your cold fusion app should be the same as viewing the report directly
in
> > the browser itself unless I'm mistaken. Where does it think the graphic
> > images are? RS puts the img src to be the GUID of the image from the
> Report
> > Server. I'm just wondering where your web page thinks the image exists.
> >
> > Tom
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
> > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
> > > I've got an online application (written in Cold Fusion) that I would
> like
> > to
> > > be able to pull in a report generated in RS. Currently, I can call the
> > > report directly from the application using an HTTP "get", pass in the
> url
> > > string with "rs:Format=PDF", save the resulting PDF file on my server,
> > then
> > > render that PDF file in my cold fusion application.
> > >
> > > What I would LIKE to do is render the report in HTML format in my
> > > application. The problem is, the report has a couple of graphs in it,
> and
> > > the resulting HTML that is generated does not know where to find the
> graph
> > > images.
> > >
> > > Is there anyway to capture the resulting HTML that is generated from
the
> > > Report Server in such a way that it can be run in another online web
> > > application (running on the same server as the RS), and yet be able to
> > > correctly fetch the generated graphical images?
> > >
> > > I hope this makes sense.
> > >
> > > TIA,
> > >
> > > Brian
> > >
> > >
> >
> >
>|||Ok, i researched IFRAMES. I used the following line to pull my report into
the browser:
<IFRAME scrolling="Yes" frameborder="0" height="100%" width="100%"
NAME="Frame1" src="http://pics.10026.com/?src=pathToMyReportWithParameters" ALLOWTRANSPARENCY="true">
The browser rendered my report, even displayed the little spinning
"Generating Report". But alas, the graphs are still missing. Any ideas?
"Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
news:%23liwlz6XEHA.2816@.TK2MSFTNGP11.phx.gbl...
> I don't know that much about CF so as you say, it may not be possible
since
> it may be a level of indirection that CF applies to the get. One other
> option that you could possibly do is create an IFRAME in your CF app that
> links directly to your report via the URL.
> Tom
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> "G" <brian.grant@.si-intl-kc.com> wrote in message
> news:O0EWee4XEHA.2868@.TK2MSFTNGP09.phx.gbl...
> > Thanks for your response Tom.
> >
> > Using the <CFHTTP> "get", i'm able to capture the HTML generated for the
> > report by the RS. Embedded in the HTML is the following <img> tag which
is
> > trying to load the graph:
> >
> > <IMG
> >
>
SRC="pathToReportServer?/pathToReport&Year=2004&rs:Format=HTML3.2&rs:ImageID
> > =C_4_S&rs:ChartImg="/>
> >
> > When my application calls the HTML page, it is unable to load this
image.
> > This is kind of a strange situation because i'm trying to load the
> graphical
> > image that the RS generated when i initially called the report a few
> seconds
> > ago using CFHTTP. The problem is, that report was called with certain
> > parameters causing that particular instance of the report to be
generated
> > with that particular instance of the graph.
> >
> > What I'm trying to do here might not be possible.
> >
> > Brian
> >
> > "Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
> > news:ubA4CB4XEHA.1128@.TK2MSFTNGP10.phx.gbl...
> > > Your cold fusion app should be the same as viewing the report directly
> in
> > > the browser itself unless I'm mistaken. Where does it think the
graphic
> > > images are? RS puts the img src to be the GUID of the image from the
> > Report
> > > Server. I'm just wondering where your web page thinks the image
exists.
> > >
> > > Tom
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > >
> > >
> > >
> > > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > > news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
> > > > I've got an online application (written in Cold Fusion) that I would
> > like
> > > to
> > > > be able to pull in a report generated in RS. Currently, I can call
the
> > > > report directly from the application using an HTTP "get", pass in
the
> > url
> > > > string with "rs:Format=PDF", save the resulting PDF file on my
server,
> > > then
> > > > render that PDF file in my cold fusion application.
> > > >
> > > > What I would LIKE to do is render the report in HTML format in my
> > > > application. The problem is, the report has a couple of graphs in
it,
> > and
> > > > the resulting HTML that is generated does not know where to find the
> > graph
> > > > images.
> > > >
> > > > Is there anyway to capture the resulting HTML that is generated from
> the
> > > > Report Server in such a way that it can be run in another online web
> > > > application (running on the same server as the RS), and yet be able
to
> > > > correctly fetch the generated graphical images?
> > > >
> > > > I hope this makes sense.
> > > >
> > > > TIA,
> > > >
> > > > Brian
> > > >
> > > >
> > >
> > >
> >
> >
>|||As I said in a previous post, I too cannot get images out a HTML.
I'm using the web service to spit out the HTML which I stream out to the user.
The IMG_SRC has someting in it similar to what you report, which doesn't result in an image coming out.
Matt
"G" wrote:
> Ok, i researched IFRAMES. I used the following line to pull my report into
> the browser:
> <IFRAME scrolling="Yes" frameborder="0" height="100%" width="100%"
> NAME="Frame1" src="http://pics.10026.com/?src=pathToMyReportWithParameters" ALLOWTRANSPARENCY="true">
> The browser rendered my report, even displayed the little spinning
> "Generating Report". But alas, the graphs are still missing. Any ideas?
>
> "Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
> news:%23liwlz6XEHA.2816@.TK2MSFTNGP11.phx.gbl...
> > I don't know that much about CF so as you say, it may not be possible
> since
> > it may be a level of indirection that CF applies to the get. One other
> > option that you could possibly do is create an IFRAME in your CF app that
> > links directly to your report via the URL.
> >
> > Tom
> >
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
> > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > news:O0EWee4XEHA.2868@.TK2MSFTNGP09.phx.gbl...
> > > Thanks for your response Tom.
> > >
> > > Using the <CFHTTP> "get", i'm able to capture the HTML generated for the
> > > report by the RS. Embedded in the HTML is the following <img> tag which
> is
> > > trying to load the graph:
> > >
> > > <IMG
> > >
> >
> src="http://pics.10026.com/?src=pathToReportServer?/pathToReport&Year=2004&rs:Format=HTML3.2&rs:ImageID
> > > =C_4_S&rs:ChartImg="/>
> > >
> > > When my application calls the HTML page, it is unable to load this
> image.
> > > This is kind of a strange situation because i'm trying to load the
> > graphical
> > > image that the RS generated when i initially called the report a few
> > seconds
> > > ago using CFHTTP. The problem is, that report was called with certain
> > > parameters causing that particular instance of the report to be
> generated
> > > with that particular instance of the graph.
> > >
> > > What I'm trying to do here might not be possible.
> > >
> > > Brian
> > >
> > > "Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
> > > news:ubA4CB4XEHA.1128@.TK2MSFTNGP10.phx.gbl...
> > > > Your cold fusion app should be the same as viewing the report directly
> > in
> > > > the browser itself unless I'm mistaken. Where does it think the
> graphic
> > > > images are? RS puts the img src to be the GUID of the image from the
> > > Report
> > > > Server. I'm just wondering where your web page thinks the image
> exists.
> > > >
> > > > Tom
> > > >
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > >
> > > >
> > > >
> > > > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > > > news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
> > > > > I've got an online application (written in Cold Fusion) that I would
> > > like
> > > > to
> > > > > be able to pull in a report generated in RS. Currently, I can call
> the
> > > > > report directly from the application using an HTTP "get", pass in
> the
> > > url
> > > > > string with "rs:Format=PDF", save the resulting PDF file on my
> server,
> > > > then
> > > > > render that PDF file in my cold fusion application.
> > > > >
> > > > > What I would LIKE to do is render the report in HTML format in my
> > > > > application. The problem is, the report has a couple of graphs in
> it,
> > > and
> > > > > the resulting HTML that is generated does not know where to find the
> > > graph
> > > > > images.
> > > > >
> > > > > Is there anyway to capture the resulting HTML that is generated from
> > the
> > > > > Report Server in such a way that it can be run in another online web
> > > > > application (running on the same server as the RS), and yet be able
> to
> > > > > correctly fetch the generated graphical images?
> > > > >
> > > > > I hope this makes sense.
> > > > >
> > > > > TIA,
> > > > >
> > > > > Brian
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>|||Take a look at this sample from books online
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_49f6.asp
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"G" <brian.grant@.si-intl-kc.com> wrote in message
news:O0EWee4XEHA.2868@.TK2MSFTNGP09.phx.gbl...
> Thanks for your response Tom.
> Using the <CFHTTP> "get", i'm able to capture the HTML generated for the
> report by the RS. Embedded in the HTML is the following <img> tag which is
> trying to load the graph:
> <IMG
>
SRC="pathToReportServer?/pathToReport&Year=2004&rs:Format=HTML3.2&rs:ImageID
> =C_4_S&rs:ChartImg="/>
> When my application calls the HTML page, it is unable to load this image.
> This is kind of a strange situation because i'm trying to load the
graphical
> image that the RS generated when i initially called the report a few
seconds
> ago using CFHTTP. The problem is, that report was called with certain
> parameters causing that particular instance of the report to be generated
> with that particular instance of the graph.
> What I'm trying to do here might not be possible.
> Brian
> "Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
> news:ubA4CB4XEHA.1128@.TK2MSFTNGP10.phx.gbl...
> > Your cold fusion app should be the same as viewing the report directly
in
> > the browser itself unless I'm mistaken. Where does it think the graphic
> > images are? RS puts the img src to be the GUID of the image from the
> Report
> > Server. I'm just wondering where your web page thinks the image exists.
> >
> > Tom
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
> > "G" <brian.grant@.si-intl-kc.com> wrote in message
> > news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
> > > I've got an online application (written in Cold Fusion) that I would
> like
> > to
> > > be able to pull in a report generated in RS. Currently, I can call the
> > > report directly from the application using an HTTP "get", pass in the
> url
> > > string with "rs:Format=PDF", save the resulting PDF file on my server,
> > then
> > > render that PDF file in my cold fusion application.
> > >
> > > What I would LIKE to do is render the report in HTML format in my
> > > application. The problem is, the report has a couple of graphs in it,
> and
> > > the resulting HTML that is generated does not know where to find the
> graph
> > > images.
> > >
> > > Is there anyway to capture the resulting HTML that is generated from
the
> > > Report Server in such a way that it can be run in another online web
> > > application (running on the same server as the RS), and yet be able to
> > > correctly fetch the generated graphical images?
> > >
> > > I hope this makes sense.
> > >
> > > TIA,
> > >
> > > Brian
> > >
> > >
> >
> >
>|||Yes, you are responsible to managing the images. Since the end user is not
talking directly to the Report Server, the server doesn't know when the
session is no longer valid.
--
Brian Welcker
Group Program Manager
SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt P" <MattP@.discussions.microsoft.com> wrote in message
news:32316ADD-BD93-496A-9261-D6D92C96EDC4@.microsoft.com...
> Thanks. After much fiddling with paths I managed to solve the problem.
> Things I had to do additionally/differently to the BOL online article
> were:
> - pass in the same parameters as to the Render method
> - path in a full path in the StreamRoot parameter.
> EG \\the-host-name\Collaborators\BXYZDevtMain\ManagementReports\
> The help is most unclear in this respect. To my readin git meant that
> that was where the images are being read from on the report server. No -
> its the path on the web server to where I am to have copied the images in
> the manner indicated by the BOL code. And unless it's in a format I've
> shown above it's completely ignored, and the full 'gibberish' URL put as
> the IMG SRC - with all the parameters etc.
>
> Am I responsible for deleting the image files after a certain time?
> thanks
> Matt
>
> "Tudor Trufinescu (MSFT)" wrote:
>> Take a look at this sample from books online
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_ref_soapapi_service_lz_49f6.asp
>> --
>> Tudor Trufinescu
>> Dev Lead
>> Sql Server Reporting Services
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "G" <brian.grant@.si-intl-kc.com> wrote in message
>> news:O0EWee4XEHA.2868@.TK2MSFTNGP09.phx.gbl...
>> > Thanks for your response Tom.
>> >
>> > Using the <CFHTTP> "get", i'm able to capture the HTML generated for
>> > the
>> > report by the RS. Embedded in the HTML is the following <img> tag which
>> > is
>> > trying to load the graph:
>> >
>> > <IMG
>> >
>> src="http://pics.10026.com/?src=pathToReportServer?/pathToReport&Year=2004&rs:Format=HTML3.2&rs:ImageID
>> > =C_4_S&rs:ChartImg="/>
>> >
>> > When my application calls the HTML page, it is unable to load this
>> > image.
>> > This is kind of a strange situation because i'm trying to load the
>> graphical
>> > image that the RS generated when i initially called the report a few
>> seconds
>> > ago using CFHTTP. The problem is, that report was called with certain
>> > parameters causing that particular instance of the report to be
>> > generated
>> > with that particular instance of the graph.
>> >
>> > What I'm trying to do here might not be possible.
>> >
>> > Brian
>> >
>> > "Tom Rizzo [MSFT]" <thomriz@.microsoft.com> wrote in message
>> > news:ubA4CB4XEHA.1128@.TK2MSFTNGP10.phx.gbl...
>> > > Your cold fusion app should be the same as viewing the report
>> > > directly
>> in
>> > > the browser itself unless I'm mistaken. Where does it think the
>> > > graphic
>> > > images are? RS puts the img src to be the GUID of the image from the
>> > Report
>> > > Server. I'm just wondering where your web page thinks the image
>> > > exists.
>> > >
>> > > Tom
>> > >
>> > > This posting is provided "AS IS" with no warranties, and confers no
>> > rights.
>> > >
>> > >
>> > >
>> > > "G" <brian.grant@.si-intl-kc.com> wrote in message
>> > > news:OpKlO72XEHA.2344@.TK2MSFTNGP11.phx.gbl...
>> > > > I've got an online application (written in Cold Fusion) that I
>> > > > would
>> > like
>> > > to
>> > > > be able to pull in a report generated in RS. Currently, I can call
>> > > > the
>> > > > report directly from the application using an HTTP "get", pass in
>> > > > the
>> > url
>> > > > string with "rs:Format=PDF", save the resulting PDF file on my
>> > > > server,
>> > > then
>> > > > render that PDF file in my cold fusion application.
>> > > >
>> > > > What I would LIKE to do is render the report in HTML format in my
>> > > > application. The problem is, the report has a couple of graphs in
>> > > > it,
>> > and
>> > > > the resulting HTML that is generated does not know where to find
>> > > > the
>> > graph
>> > > > images.
>> > > >
>> > > > Is there anyway to capture the resulting HTML that is generated
>> > > > from
>> the
>> > > > Report Server in such a way that it can be run in another online
>> > > > web
>> > > > application (running on the same server as the RS), and yet be able
>> > > > to
>> > > > correctly fetch the generated graphical images?
>> > > >
>> > > > I hope this makes sense.
>> > > >
>> > > > TIA,
>> > > >
>> > > > Brian
>> > > >
>> > > >
>> > >
>> > >
>> >
>> >
>>

Monday, March 12, 2012

PULL replication with SQL Server Express, it is possible whether or not?

Hello!

Question of such plan, to documentation to Microsoft SQL Server 2005 Express Edition it is written, that the given product supports only PUSH replication, however in his{its} structure there is an agent replmerg.exe which description says:

replication merge. Synchronization means, that the agent of merge transfers changes from the subscriber to the publisher, and then transfers changes from the publisher on the subscriber …

And so the question if this agent is present at this edition, whether that is possible to adjust manually his{its} call, or through Windows the agent, for realization PULL replication or it is impossible and for what reasons?

Thanks.

You can find replmerg.exe in Program Files\Microsoft SQL Server\90\COM even on an Express instance.

The missing thing in Express is the SQL Server agent. Hence the merge agent cannot be started using SQL Server agent with a pull subscription. If you want to use the SQL Server agent in this setup then you will need to use push subscription. Or you can get by and use the executable or use Windows Synchronization manager or use RMO components to start the merge agent programatically.

|||

And why I cannot use instead of SQL Server Agent, Scheduled Tasks Windows, For start replmerg.exe with parameters PULL of the subscriber, or my attempt will not be possible? Why?

|||

I do not understand your question. You can use one of the following:

1. Windows sync manager (pull subscription)

2. Command line executable replmerg.exe

3. RMO objects.

|||

You have told that:

1. Windows sync manager (pull subscription) It Is possible{probable}, yes?

Probably, on SQL Server Expression to realize PULL replication with help Windows sync manager with use of the utility replmerg.exe?

I simply did not use never Windows sync manager.

|||

Windows sync manager is separate from using the replmerg.exe command line tool.

Windows Sync manager can be found in Start-->Programs-->Accessories-->SYnchronize.

For more info refer to:

http://msdn2.microsoft.com/en-us/library/ms165714.aspx

http://msdn2.microsoft.com/en-us/library/ms151863.aspx

|||

Ok, thanks!!! You have very much helped, all has turned out:-)

|||

When I have adjusted pull replication SQL Server express and have set the schedule of performance with help Windows Sync manager, at each start it{he} asks login and password for communication{connection} with Publisher and Distributer? How to make that it{he} did not ask these given, and all did{made} automatically?

|||I am not sure if you can save the credentials.|||

I have bad understood the answer, here is here detailed description of the question, I his(its) has described, read and help to solve a problem. Thank you!

http://www.replication2006.narod.ru/SQLEPW.mht

|||

Are you asking that what you could do with Windows sync manager, can it be done with Merge agent replmerg.exe?

If so, yes. You need the appropriate parameters set for the utility. Running replmerg.exe /? will show you all the available parameters and set them accordingly and run it. It should succeed.

|||

OK thank you, problem is solved.

Friday, March 9, 2012

Pull between 2 dates from user input

I want to pull dates from my database that are between to set dates i have written a query that does this which looks like this:

"SELECT OCH_ID, empno, Selected_OCD, Start_Time, End_Time, Selected_OCDay, Selected_DOM, Selected_Month, Selected_Year FROM dbo.ICT_On_Call_Hours WHERE (CONVERT (datetime, LEFT (Selected_OCD, 2) + '/' + SUBSTRING(Selected_OCD, 4, 2) + '/' + RIGHT (Selected_OCD, 4)) >= CONVERT (datetime, LEFT ('12/02/2007', 2) + '/' + SUBSTRING('12/02/2007', 4, 2) + '/' + RIGHT ('12/02/2007', 4))) AND (CONVERT (datetime, LEFT (Selected_OCD, 2) + '/' + SUBSTRING(Selected_OCD, 4, 2) + '/' + RIGHT (Selected_OCD, 4)) < CONVERT (datetime, LEFT ('14/02/2007', 2) + '/' + SUBSTRING('14/02/2007', 4, 2) + '/' + RIGHT ('14/02/2007', 4)))"

This works when the dates are included in the statement but when i try and use parameters to pull them in like this:

"SELECT OCH_ID, empno, Selected_OCD, Start_Time, End_Time, Selected_OCDay, Selected_DOM, Selected_Month, Selected_Year FROM dbo.ICT_On_Call_Hours WHERE (CONVERT (datetime, LEFT (Selected_OCD, 2) + '/' + SUBSTRING(Selected_OCD, 4, 2) + '/' + RIGHT (Selected_OCD, 4)) >= CONVERT (datetime, LEFT ('@.Choice1', 2) + '/' + SUBSTRING('@.Choice1', 4, 2) + '/' + RIGHT ('@.Choice1', 4))) AND (CONVERT (datetime, LEFT (Selected_OCD, 2) + '/' + SUBSTRING(Selected_OCD, 4, 2) + '/' + RIGHT (Selected_OCD, 4)) < CONVERT (datetime, LEFT ('@.Choice2', 2) + '/' + SUBSTRING('@.Choice2', 4, 2) + '/' + RIGHT ('@.Choice2', 4)))"

I then recieve the following error message why is this?

ERROR ------> Syntax error converting datetime from character string.

Any Help would be greatly appreciated thanks

Dont surround a parameter with single quotes. Also if choice1 is a data already why not try something like this

"SELECT OCH_ID, empno, Selected_OCD, Start_Time, End_Time, Selected_OCDay, Selected_DOM, Selected_Month, Selected_Year FROM dbo.ICT_On_Call_Hours WHERE (CONVERT (datetime, LEFT (Selected_OCD, 2) + '/' + SUBSTRING(Selected_OCD, 4, 2) + '/' + RIGHT (Selected_OCD, 4)) >=@.Choice1 AND (CONVERT (datetime, LEFT (Selected_OCD, 2) + '/' + SUBSTRING(Selected_OCD, 4, 2) + '/' + RIGHT (Selected_OCD, 4)) <@.Choice2"

|||

Thanks for the immediate response that works perfectly exactly what i wanted

Thanks Again

Dazza22