Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Wednesday, March 28, 2012

Problem with SQL Script with Clarion Date format

I need to run a sql script to update records in a table that were created
that day. I have a huge database and it would take a while to run a script
on all.
Here's what i have so far: (this is a select stmt version not update stmt
i'm using for testing)
SELECT tm5user.matter.c_date as CreateDate,
((tm5user.matter.c_date)-(1800-12-28))as CalcDate, *
FROM tm5user.matter
INNER JOIN tm5user.billopt ON tm5user.matter.sysid = tm5user.billopt.owner_id
WHERE tm5user.matter.c_date>=((tm5user.matter.c_date)-(1800-12-28))
I got the script to work but it doesn't calculate the date correctly. The
date field "c_date" is based on a clarion base date of 12/28/1800.
I have my select statement return the "c_date" field, the calculated date
field, and full table columns for testing. The CreateDate and CalcDate
should be equal and they are not.
Does anyone have any ideas ... I tried CastDate that also did not work.
Any help or tips would be great ..... thanks.
rob bartley
msce> ((tm5user.matter.c_date)-(1800-12-28))as CalcDate
The above expression (1800-12-28) is doing integer arithmetic. I suggest you use the DATEDIFF or
DATEADD function (depending on what you want to achieve). Also, I suggest you format the date in
language neutral format ('yyyymmdd') so it doesn't break in a nationalized environment.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Rob" <temp@.dstek.com> wrote in message news:us1cOsGtDHA.1884@.TK2MSFTNGP10.phx.gbl...
> I need to run a sql script to update records in a table that were created
> that day. I have a huge database and it would take a while to run a script
> on all.
> Here's what i have so far: (this is a select stmt version not update stmt
> i'm using for testing)
> SELECT tm5user.matter.c_date as CreateDate,
> ((tm5user.matter.c_date)-(1800-12-28))as CalcDate, *
> FROM tm5user.matter
> INNER JOIN tm5user.billopt ON tm5user.matter.sysid => tm5user.billopt.owner_id
> WHERE tm5user.matter.c_date>=((tm5user.matter.c_date)-(1800-12-28))
>
> I got the script to work but it doesn't calculate the date correctly. The
> date field "c_date" is based on a clarion base date of 12/28/1800.
> I have my select statement return the "c_date" field, the calculated date
> field, and full table columns for testing. The CreateDate and CalcDate
> should be equal and they are not.
> Does anyone have any ideas ... I tried CastDate that also did not work.
> Any help or tips would be great ..... thanks.
> rob bartley
> msce
>

Friday, March 9, 2012

Problem with Report viewer

This is a multi-part message in MIME format.
--=_NextPart_000_0006_01C6EDDF.D2BB2D90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I recently upgraded by ASP.Net 1.1 application to 2.0. 1.1 application = was using awReportViewer to view the reports.
But, when upgraded, awreportViewer doesnt display the RS2005 = enhancements like sorting, etc...so I decided to replace it with Report = Viewer control in VS2005.
Now the problem starts, Whenever I try accesing the reports, it gives me = error "Client found response content type of '', but expected = 'text/xml'.
The request failed with an empty response."
This is how I have coded,
ReportViewer1.ProcessingMode =3D ProcessingMode.Remote
ReportViewer1.ServerReport.ReportServerUrl =3D New = Uri(http://localhost/ReportServer/reportservice.asmx)
ReportViewer1.ServerReport.ReportPath =3D reportname
//Some code to set parameters in Report Paramater "parameters"
ReportViewer1.ServerReport.SetParameters(parameters)
My questions:
1. Am I going wrong somewhere in the above code?
2. Can awReportViewer be modified / upgraded so that it can support = RS2005 features like sorting, multivalued parameters?
TIA
Tanmaya
--=_NextPart_000_0006_01C6EDDF.D2BB2D90
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hi,

I recently upgraded by ASP.Net 1.1 = application to 2.0. 1.1 application was using awReportViewer to view the = reports.
But, when upgraded, awreportViewer = doesnt display the RS2005 enhancements like sorting, etc...so I decided to replace it = with Report Viewer control in VS2005.

Now the problem starts, Whenever I try = accesing the reports, it gives me error "Client found response content type = of '', but expected 'text/xml'.The request failed with an empty response."

This is how I have coded,

ReportViewer1.ProcessingMode =3D ProcessingMode.Remote
ReportViewer1.ServerReport.ReportServerUrl =3D New Uri(http://localhost/ReportServer/reportservice.asmx)
ReportViewer1.ServerReport.ReportPath =3D = reportname
//Some code to set parameters in Report = Paramater "parameters"
ReportViewer1.ServerReport.SetParameters(parameters)
My questions:
1. Am I going wrong somewhere in the = above code?
2. Can awReportViewer be modified / = upgraded so that it can support RS2005 features like sorting, multivalued = parameters?
TIA
Tanmaya
--=_NextPart_000_0006_01C6EDDF.D2BB2D90--On Thu, 12 Oct 2006 09:21:39 +0530, "Tan"
<tanmaya_kulkarni@.persistent.co.in> wrote:
>Hi,
>I recently upgraded by ASP.Net 1.1 application to 2.0. 1.1 application was using awReportViewer to view the reports.
>But, when upgraded, awreportViewer doesnt display the RS2005 enhancements like sorting, etc...so I decided to replace it with Report Viewer control in VS2005.
>Now the problem starts, Whenever I try accesing the reports, it gives me error "Client found response content type of '', but expected 'text/xml'.
>The request failed with an empty response."
>This is how I have coded,
>ReportViewer1.ProcessingMode = ProcessingMode.Remote
>ReportViewer1.ServerReport.ReportServerUrl = New Uri(http://localhost/ReportServer/reportservice.asmx)
>ReportViewer1.ServerReport.ReportPath = reportname
>//Some code to set parameters in Report Paramater "parameters"
>ReportViewer1.ServerReport.SetParameters(parameters)
>My questions:
>1. Am I going wrong somewhere in the above code?
>2. Can awReportViewer be modified / upgraded so that it can support RS2005 features like sorting, multivalued parameters?
>TIA
>Tanmaya
Dunno but I've never added the /reportservice.asmx at the end fo the
ReportServerURL. I've just used http://localhost/ReportServer.
Actually I set that at design time so I don't know if that makes a
difference.

Monday, February 20, 2012

Problem with parenthesis in the default value of a column

I am having a problem with the format of default values in SQL Server 2005.
I
am using a legacy application that is not expecting the double parenthesis
around the default value that SQL Server adds. For instance, if
I set 0 (zero) as the default value for a column of type int as follows
ALTER TABLE Entity ADD CONSTRAINT [DF_Entity_Class] DEFAULT 0 FOR
Class)
then SQL Server will set the default value as ((0)). The problem is that the
legacy application is validating the default values and expecting just 0. I
own the database but have no control over the application. Therefore, I
cannot change the application to remove the parenthesis after reading the
value.
Is there any way to force SQL Server to store the default value without the
parenthesis or to return it without the parenthesis (note that the
application is reading the database tables directly).
Regards,
ArturHi
I don't think you can change the way it is stored but you could use the
REPLACE function to strip out the braces when you return it.
John
"artur" wrote:

> I am having a problem with the format of default values in SQL Server 2005
. I
> am using a legacy application that is not expecting the double parenthesis
> around the default value that SQL Server adds. For instance, if
> I set 0 (zero) as the default value for a column of type int as follows
> ALTER TABLE Entity ADD CONSTRAINT [DF_Entity_Class] DEFAULT 0 FOR
> Class)
> then SQL Server will set the default value as ((0)). The problem is that t
he
> legacy application is validating the default values and expecting just 0.
I
> own the database but have no control over the application. Therefore, I
> cannot change the application to remove the parenthesis after reading the
> value.
> Is there any way to force SQL Server to store the default value without th
e
> parenthesis or to return it without the parenthesis (note that the
> application is reading the database tables directly).
> Regards,
> Artur

Problem with parenthesis in the default value of a column

I am having a problem with the format of default values in SQL Server 2005. I
am using a legacy application that is not expecting the double parenthesis
around the default value that SQL Server adds. For instance, if
I set 0 (zero) as the default value for a column of type int as follows
ALTER TABLE Entity ADD CONSTRAINT [DF_Entity_Class] DEFAULT 0 FOR
Class)
then SQL Server will set the default value as ((0)). The problem is that the
legacy application is validating the default values and expecting just 0. I
own the database but have no control over the application. Therefore, I
cannot change the application to remove the parenthesis after reading the
value.
Is there any way to force SQL Server to store the default value without the
parenthesis or to return it without the parenthesis (note that the
application is reading the database tables directly).
Regards,
ArturHi
I don't think you can change the way it is stored but you could use the
REPLACE function to strip out the braces when you return it.
John
"artur" wrote:
> I am having a problem with the format of default values in SQL Server 2005. I
> am using a legacy application that is not expecting the double parenthesis
> around the default value that SQL Server adds. For instance, if
> I set 0 (zero) as the default value for a column of type int as follows
> ALTER TABLE Entity ADD CONSTRAINT [DF_Entity_Class] DEFAULT 0 FOR
> Class)
> then SQL Server will set the default value as ((0)). The problem is that the
> legacy application is validating the default values and expecting just 0. I
> own the database but have no control over the application. Therefore, I
> cannot change the application to remove the parenthesis after reading the
> value.
> Is there any way to force SQL Server to store the default value without the
> parenthesis or to return it without the parenthesis (note that the
> application is reading the database tables directly).
> Regards,
> Artur

Problem with osql.exe -L

This is a multi-part message in MIME format.
--=_NextPart_000_0033_01C566E6.B2395460
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Everyone,
I'm facing a small problem. Whenever I execute osql.exe -L command it = lists all the server on the network except my local server instance (not = default instance) and other similar server instance names on the = network.
Earlier it use to list all the server instance but all of a sudden = stopped listing.
What can be the problem? Please help me to rectify this issue.
Thanks in adv.
Regards,
BGS
--=_NextPart_000_0033_01C566E6.B2395460
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hi Everyone,I'm facing a small problem. Whenever I execute osql.exe = -L command it lists all the server on the network except my local = server instance (not default instance) and other similar server instance names = on the network.Earlier it use to list all the server instance but all = of a sudden stopped listing.What can be the problem? Please help me = to rectify this issue.Thanks in adv.Regards,BGS
--=_NextPart_000_0033_01C566E6.B2395460--OSQL -L uses the ODBC SQLBrowseConnect functionality. It's
not guaranteed to give a complete list due to broadcast
issues, network routers/subnet issues, instances may not
respond within the timeout period, etc. You can find issues
listed here:
http://www.sqldev.net/misc/ListSQLSvr.htm
-Sue
On Wed, 1 Jun 2005 20:15:46 +0530, "Gururaj Badam"
<gururajb@.msn.com> wrote:
>Hi Everyone,
>I'm facing a small problem. Whenever I execute osql.exe -L command it lists all the server on the network except my local server instance (not default instance) and other similar server instance names on the network.
>Earlier it use to list all the server instance but all of a sudden stopped listing.
>What can be the problem? Please help me to rectify this issue.
>Thanks in adv.
>Regards,
>BGS|||Sue,
Is ListAvailableSQLServers in SQL-DMO is also same as "osql -L" command?
Actually I'm trying to populate a ComboBox with list of all the SQL Servers
on the network and set the default to the Local Server (desired instance).
Can you suggest some other better mechanism which can be used to acheive the
same?
-BGS|||ListAvailableServers is also based on the ODBC function
SQLBrowseConnect. If you need a guaranteed list and are
running SQL 2000, you could register all SQL Servers in AD
and go through AD to list all of SQL Servers.
-Sue
On Thu, 2 Jun 2005 09:57:10 +0530, "Gururaj Badam"
<gururajb@.msn.com> wrote:
>Sue,
>Is ListAvailableSQLServers in SQL-DMO is also same as "osql -L" command?
>Actually I'm trying to populate a ComboBox with list of all the SQL Servers
>on the network and set the default to the Local Server (desired instance).
>Can you suggest some other better mechanism which can be used to acheive the
>same?
>-BGS
>|||Sue,
Actually I'm not using SQL 2k but MSDE installation. It is a product, I
can't ask the client to install SQL Server 2000.
That's the reason I'm packing the MSDE along with the application
installation package.
-BGS
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:g9ut91daj141d35g8v2dn133q713uo9ieq@.4ax.com...
> ListAvailableServers is also based on the ODBC function
> SQLBrowseConnect. If you need a guaranteed list and are
> running SQL 2000, you could register all SQL Servers in AD
> and go through AD to list all of SQL Servers.
> -Sue
>|||MSDE is SQL Server, so everything that Sue mentioned still applies.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Gururaj Badam" <gururajb@.msn.com> wrote in message news:OV9E6C3ZFHA.2916@.TK2MSFTNGP14.phx.gbl...
> Sue,
> Actually I'm not using SQL 2k but MSDE installation. It is a product, I
> can't ask the client to install SQL Server 2000.
> That's the reason I'm packing the MSDE along with the application
> installation package.
> -BGS
>
> "Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
> news:g9ut91daj141d35g8v2dn133q713uo9ieq@.4ax.com...
>> ListAvailableServers is also based on the ODBC function
>> SQLBrowseConnect. If you need a guaranteed list and are
>> running SQL 2000, you could register all SQL Servers in AD
>> and go through AD to list all of SQL Servers.
>> -Sue
>|||Tibor,
How can I ask the user of my product to register the SQL Server with the AD,
that looks odd.
Is there any other way to approach this problem?
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23AYiWX3ZFHA.3040@.TK2MSFTNGP14.phx.gbl...
> MSDE is SQL Server, so everything that Sue mentioned still applies.
> --
> Tibor Karaszi, SQL Server MVP