Wednesday, March 28, 2012
Problem with liinked server
--=_NextPart_000_00A3_01C79966.58D0C7A0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
Hi,
I have two sql server. One is sql 2000, and another is sql 2005
On sql 2000 I try to add linked to sql 2005.
(like this)
exec sp_addlinkedserver @.server =3D N'ZAGREB_NEW',
@.srvproduct =3D N' ',
@.provider =3D N'SQLNCLI',
@.datasrc =3D N'',
@.catalog =3D N'komitenti',
@.provstr =3D N'SERVER=3DZAGREB_NEW;uid=3Dradovan;pwd=3DDELTA555'
GO
I try
SELECT top 1 adresa from zagreb_new.komitenti.dbo.komitenti
and have followig error:
OLE DB error trace [Non-interface error: Column 'MB' (compile-time = ordinal 4) of object '"komitenti"."dbo"."komitenti"' was reported to = have changed. The exact nature of the change is unknown].
Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column. = Metadata information was changed at execution time.
When I try:
SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM = komitenti.dbo.komitenti')
I got result.
How can I exec stored procedure on linked server, because
exec Zagreb_new.database.dbo.Mystored doesn't work
error is:
Msg 7212, Level 17, State 1, Line 1
Could not execute procedure 'spG_ProvjeriMB' on remote server = 'zagreb_new'.
--=_NextPart_000_00A3_01C79966.58D0C7A0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Hi,
I have two sql server. One is sql 2000, = and another is sql 2005
On sql 2000 I try to add linked to sql 2005.
(like this)
exec sp_addlinkedserver @.server =3D N'ZAGREB_NEW',
@.srvproduct =3D N' ',
@.provider =3D N'SQLNCLI',
@.datasrc =3D N'',
@.catalog =3D N'komitenti',
@.provstr =3D N'SERVER=3DZAGREB_NEW;uid=3Dradovan;pwd=3DDELTA555'
GO
I try
SELECT top 1 adresa from zagreb_new.komitenti.dbo.komitenti
and have followig error:
OLE DB error trace [Non-interface error: = Column 'MB' (compile-time ordinal 4) of object '"komitenti"."dbo"."komitenti"' was = reported to have changed. The exact nature of the change is unknown].
Msg 7356, Level 16, State 1, Line = 1
OLE DB provider 'SQLNCLI' supplied = inconsistent metadata for a column. Metadata information was changed at execution time.
When I try:
SELECT * FROM OPENQUERY(ZAGREB_NEW, = 'SELECT TOP 1 * FROM komitenti.dbo.komitenti')
I got result.
How can I exec stored procedure on linked = server, because
exec Zagreb_new.database.dbo.Mystored = doesn't work
error is:
Msg 7212, Level 17, State 1, Line 1
Could not execute procedure 'spG_ProvjeriMB' on remote = server 'zagreb_new'.
--=_NextPart_000_00A3_01C79966.58D0C7A0--Hi
"Radovan DobriÄ?" wrote:
> Hi,
> I have two sql server. One is sql 2000, and another is sql 2005
> On sql 2000 I try to add linked to sql 2005.
> (like this)
> exec sp_addlinkedserver @.server = N'ZAGREB_NEW',
> @.srvproduct = N' ',
> @.provider = N'SQLNCLI',
> @.datasrc = N'',
> @.catalog = N'komitenti',
> @.provstr = N'SERVER=ZAGREB_NEW;uid=radovan;pwd=DELTA555'
> GO
>
> I try
> SELECT top 1 adresa from zagreb_new.komitenti.dbo.komitenti
> and have followig error:
>
> OLE DB error trace [Non-interface error: Column 'MB' (compile-time ordinal 4) of object '"komitenti"."dbo"."komitenti"' was reported to have changed. The exact nature of the change is unknown].
> Msg 7356, Level 16, State 1, Line 1
> OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column. Metadata information was changed at execution time.
>
> When I try:
> SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM komitenti.dbo.komitenti')
> I got result.
>
> How can I exec stored procedure on linked server, because
> exec Zagreb_new.database.dbo.Mystored doesn't work
> error is:
>
> Msg 7212, Level 17, State 1, Line 1
> Could not execute procedure 'spG_ProvjeriMB' on remote server 'zagreb_new'
The only thing I have found about this is that "it could be fixed in SP2"
which versions are the servers running? Is the client one of the servers?
Is a login defined for the linked server? See
http://msdn2.microsoft.com/en-us/library/ms189811.aspx or are you using the
default mapping, in which case will the login have permissions on the remote
server? Your error message when running the remote procedure would indicate
that they don't have permissions to run this.
John|||Hi,
I have sp2 on server (I try it on another server with sp2 in another firm
and have exactly same result).
I try it with sql server account (and did mapping on that account). That
account have admin privil.
radovan
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:BE5DF476-CF21-4F8C-8634-D4461EA9132F@.microsoft.com...
> Hi
> "Radovan Dobriæ" wrote:
>> Hi,
>> I have two sql server. One is sql 2000, and another is sql 2005
>> On sql 2000 I try to add linked to sql 2005.
>> (like this)
>> exec sp_addlinkedserver @.server = N'ZAGREB_NEW',
>> @.srvproduct = N' ',
>> @.provider = N'SQLNCLI',
>> @.datasrc = N'',
>> @.catalog = N'komitenti',
>> @.provstr = N'SERVER=ZAGREB_NEW;uid=radovan;pwd=DELTA555'
>> GO
>>
>> I try
>> SELECT top 1 adresa from zagreb_new.komitenti.dbo.komitenti
>> and have followig error:
>>
>> OLE DB error trace [Non-interface error: Column 'MB' (compile-time
>> ordinal 4) of object '"komitenti"."dbo"."komitenti"' was reported to have
>> changed. The exact nature of the change is unknown].
>> Msg 7356, Level 16, State 1, Line 1
>> OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column.
>> Metadata information was changed at execution time.
>>
>> When I try:
>> SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM
>> komitenti.dbo.komitenti')
>> I got result.
>>
>> How can I exec stored procedure on linked server, because
>> exec Zagreb_new.database.dbo.Mystored doesn't work
>> error is:
>>
>> Msg 7212, Level 17, State 1, Line 1
>> Could not execute procedure 'spG_ProvjeriMB' on remote server
>> 'zagreb_new'
> The only thing I have found about this is that "it could be fixed in SP2"
> which versions are the servers running? Is the client one of the servers?
> Is a login defined for the linked server? See
> http://msdn2.microsoft.com/en-us/library/ms189811.aspx or are you using
> the
> default mapping, in which case will the login have permissions on the
> remote
> server? Your error message when running the remote procedure would
> indicate
> that they don't have permissions to run this.
> John
>|||Hi
Have you tried creating the linked server as
EXEC sp_addlinkedserver @.server = 'ZAGREB_NEW',
@.srvproduct = N'',
@.provider = N'SQLNCLI',
@.datasrc = N'ZAGREB_NEW'
or
EXEC sp_addlinkedserver 'ZAGREB_NEW', N'SQL Server'
John
"Radovan Dobriæ" wrote:
> Hi,
> I have sp2 on server (I try it on another server with sp2 in another firm
> and have exactly same result).
> I try it with sql server account (and did mapping on that account). That
> account have admin privil.
> radovan
> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
> news:BE5DF476-CF21-4F8C-8634-D4461EA9132F@.microsoft.com...
> > Hi
> >
> > "Radovan Dobriæ" wrote:
> >
> >> Hi,
> >> I have two sql server. One is sql 2000, and another is sql 2005
> >>
> >> On sql 2000 I try to add linked to sql 2005.
> >>
> >> (like this)
> >> exec sp_addlinkedserver @.server = N'ZAGREB_NEW',
> >>
> >> @.srvproduct = N' ',
> >>
> >> @.provider = N'SQLNCLI',
> >>
> >> @.datasrc = N'',
> >>
> >> @.catalog = N'komitenti',
> >>
> >> @.provstr = N'SERVER=ZAGREB_NEW;uid=radovan;pwd=DELTA555'
> >>
> >> GO
> >>
> >>
> >>
> >> I try
> >>
> >> SELECT top 1 adresa from zagreb_new.komitenti.dbo.komitenti
> >>
> >> and have followig error:
> >>
> >>
> >>
> >> OLE DB error trace [Non-interface error: Column 'MB' (compile-time
> >> ordinal 4) of object '"komitenti"."dbo"."komitenti"' was reported to have
> >> changed. The exact nature of the change is unknown].
> >>
> >> Msg 7356, Level 16, State 1, Line 1
> >>
> >> OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column.
> >> Metadata information was changed at execution time.
> >>
> >>
> >>
> >> When I try:
> >>
> >> SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM
> >> komitenti.dbo.komitenti')
> >>
> >> I got result.
> >>
> >>
> >>
> >> How can I exec stored procedure on linked server, because
> >>
> >> exec Zagreb_new.database.dbo.Mystored doesn't work
> >>
> >> error is:
> >>
> >>
> >>
> >> Msg 7212, Level 17, State 1, Line 1
> >>
> >> Could not execute procedure 'spG_ProvjeriMB' on remote server
> >> 'zagreb_new'
> >
> > The only thing I have found about this is that "it could be fixed in SP2"
> > which versions are the servers running? Is the client one of the servers?
> >
> > Is a login defined for the linked server? See
> > http://msdn2.microsoft.com/en-us/library/ms189811.aspx or are you using
> > the
> > default mapping, in which case will the login have permissions on the
> > remote
> > server? Your error message when running the remote procedure would
> > indicate
> > that they don't have permissions to run this.
> >
> > John
> >
> >
>
>|||That was my first try.
Linked server works fine with
SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM
komitenti.dbo.komitenti')
but not with
SELECT TOP 1 * FROM zagreb_new.komitenti.dbo.komitenti'
"John Bell" <jbellnewsposts@.hotmail.com> wrote in message
news:03897BB2-0508-4F7C-A923-090DB6AE439B@.microsoft.com...
> Hi
> Have you tried creating the linked server as
> EXEC sp_addlinkedserver @.server = 'ZAGREB_NEW',
> @.srvproduct = N'',
> @.provider = N'SQLNCLI',
> @.datasrc = N'ZAGREB_NEW'
> or
> EXEC sp_addlinkedserver 'ZAGREB_NEW', N'SQL Server'
>
> John
> "Radovan Dobria" wrote:
>> Hi,
>> I have sp2 on server (I try it on another server with sp2 in another firm
>> and have exactly same result).
>> I try it with sql server account (and did mapping on that account). That
>> account have admin privil.
>> radovan
>> "John Bell" <jbellnewsposts@.hotmail.com> wrote in message
>> news:BE5DF476-CF21-4F8C-8634-D4461EA9132F@.microsoft.com...
>> > Hi
>> >
>> > "Radovan Dobria" wrote:
>> >
>> >> Hi,
>> >> I have two sql server. One is sql 2000, and another is sql 2005
>> >>
>> >> On sql 2000 I try to add linked to sql 2005.
>> >>
>> >> (like this)
>> >> exec sp_addlinkedserver @.server = N'ZAGREB_NEW',
>> >>
>> >> @.srvproduct = N' ',
>> >>
>> >> @.provider = N'SQLNCLI',
>> >>
>> >> @.datasrc = N'',
>> >>
>> >> @.catalog = N'komitenti',
>> >>
>> >> @.provstr = N'SERVER=ZAGREB_NEW;uid=radovan;pwd=DELTA555'
>> >>
>> >> GO
>> >>
>> >>
>> >>
>> >> I try
>> >>
>> >> SELECT top 1 adresa from zagreb_new.komitenti.dbo.komitenti
>> >>
>> >> and have followig error:
>> >>
>> >>
>> >>
>> >> OLE DB error trace [Non-interface error: Column 'MB' (compile-time
>> >> ordinal 4) of object '"komitenti"."dbo"."komitenti"' was reported to
>> >> have
>> >> changed. The exact nature of the change is unknown].
>> >>
>> >> Msg 7356, Level 16, State 1, Line 1
>> >>
>> >> OLE DB provider 'SQLNCLI' supplied inconsistent metadata for a column.
>> >> Metadata information was changed at execution time.
>> >>
>> >>
>> >>
>> >> When I try:
>> >>
>> >> SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM
>> >> komitenti.dbo.komitenti')
>> >>
>> >> I got result.
>> >>
>> >>
>> >>
>> >> How can I exec stored procedure on linked server, because
>> >>
>> >> exec Zagreb_new.database.dbo.Mystored doesn't work
>> >>
>> >> error is:
>> >>
>> >>
>> >>
>> >> Msg 7212, Level 17, State 1, Line 1
>> >>
>> >> Could not execute procedure 'spG_ProvjeriMB' on remote server
>> >> 'zagreb_new'
>> >
>> > The only thing I have found about this is that "it could be fixed in
>> > SP2"
>> > which versions are the servers running? Is the client one of the
>> > servers?
>> >
>> > Is a login defined for the linked server? See
>> > http://msdn2.microsoft.com/en-us/library/ms189811.aspx or are you using
>> > the
>> > default mapping, in which case will the login have permissions on the
>> > remote
>> > server? Your error message when running the remote procedure would
>> > indicate
>> > that they don't have permissions to run this.
>> >
>> > John
>> >
>> >
>>|||Hi
On May 23, 3:40 pm, "Radovan Dobri=E6" <rado...@.servis24.hr> wrote:
> That was my first try.
> Linked server works fine with
> SELECT * FROM OPENQUERY(ZAGREB_NEW, 'SELECT TOP 1 * FROM
> komitenti.dbo.komitenti')
> but not with
> SELECT TOP 1 * FROM zagreb_new.komitenti.dbo.komitenti'
>
The error you are getting would indicate that the user context that
each one is running under is different in each case.
Try mapping the local login to a different remote login using
sp_addlinkedsrvlogin
e=2Eg.
EXEC sp_addlinkedsrvlogin 'Accounts', 'false', 'Domain\Mary', 'MaryP',
'd89q3w4u'
and/or make sure that you can connect as the same user on the remote
system and execute the procedure.
John
Friday, March 23, 2012
Problem with import data from excel format file.
Hi All
I have a huge excel format file wants to export to sql server
database. One of the field has combination of numeric and
alphanumeric. When I import the excel format to sql server database,
the numeric is successfully imported but the alphanumeric does not
import at all.
Does anyone know how to solve my problem?
I am using SQL 2k and the spreadsheet is excel 2003
Thanks
Rich
You may have to use Data Conversion to convert data suitable to your SQL data type.sqlProblem with import data from excel format file.
I have a huge excel format file wants to export to sql server
database. One of the field has combination of numeric and
alphanumeric. When I import the excel format to sql server database,
the numeric is successfully imported but the alphanumeric does not
import at all.
Does anyone know how to solve my problem?
Thanks.
-HS PhuahOn 2 Dec 2003 02:21:24 -0800, hsphuah@.usa.com (Hon Seng Phuah) wrote:
>Hi all,
>I have a huge excel format file wants to export to sql server
>database. One of the field has combination of numeric and
>alphanumeric. When I import the excel format to sql server database,
>the numeric is successfully imported but the alphanumeric does not
>import at all.
>Does anyone know how to solve my problem?
>Thanks.
>-HS Phuah
Is the data in that column in the first row to be processed completely
numeric? Maybe if you sorted it such that this was alpha, sql server
would recognize the column as being alphanumeric and bring the lot in.
I'm assuming that you haven't defined the table in your db, and are
letting some tool do it for you.|||hsphuah@.usa.com (Hon Seng Phuah) wrote in message news:<3898598f.0312020221.e23a72c@.posting.google.com>...
> Hi all,
> I have a huge excel format file wants to export to sql server
> database. One of the field has combination of numeric and
> alphanumeric. When I import the excel format to sql server database,
> the numeric is successfully imported but the alphanumeric does not
> import at all.
> Does anyone know how to solve my problem?
> Thanks.
> -HS Phuah
You really need to give some more information - what version of SQL
Server, how are you importing the file, what format are the source
data in, what is the DDL for the target table, what does "not import"
mean?
One possibility is that the data type of the target column doesn't
allow alpanumeric characters. Another is that you're seeing this
issue:
http://www.sqldts.com/default.aspx?254
Simon
problem with images on the report
I am using Image control with database sourced images on my reports. The
images are stored in WMF format.
There is no problem when the report is viewed in web browser but when I
export it as a PDF or TIFF, the images are not shown and a cross (X) is
shown instead of the image.
Has anyone faced the same problem? Any help is solving this?
Regards,
AtifHave you tried converting your WMF files into one of the supported formats?
The supported formats are bmp, jpg, gif, png and jpeg.
Charles Kangai, MCT, MCDBA
"Abdus Salam Atif" wrote:
> Hello All,
> I am using Image control with database sourced images on my reports. The
> images are stored in WMF format.
> There is no problem when the report is viewed in web browser but when I
> export it as a PDF or TIFF, the images are not shown and a cross (X) is
> shown instead of the image.
> Has anyone faced the same problem? Any help is solving this?
> Regards,
> Atif
>
>|||I have also tried to convert the WMF files to PNG, which is the only
accepted format for my application and web, this gives me a different
behavior. The reports look fine in the preview and I am also able to
generate a correct PDF from the preview window but not showing images when I
open the report in the web browser.
Regards,
Atif
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:ABD7F597-8056-4BDA-B4B9-7D5E7A9DA017@.microsoft.com...
> Have you tried converting your WMF files into one of the supported
formats?
> The supported formats are bmp, jpg, gif, png and jpeg.
> Charles Kangai, MCT, MCDBA
> "Abdus Salam Atif" wrote:
> > Hello All,
> >
> > I am using Image control with database sourced images on my reports. The
> > images are stored in WMF format.
> >
> > There is no problem when the report is viewed in web browser but when I
> > export it as a PDF or TIFF, the images are not shown and a cross (X) is
> > shown instead of the image.
> >
> > Has anyone faced the same problem? Any help is solving this?
> >
> > Regards,
> > Atif
> >
> >
> >|||Just to explain how am I converting the images, images are still in WMF
format in the DB, I am using a C# assembly to convert the images using a
function at runtime. The function takes image field from DB as parameter and
returns the converted PNG image. This is written as an expression in the
value property of image control.
Regards,
Atif
"Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in message
news:ABD7F597-8056-4BDA-B4B9-7D5E7A9DA017@.microsoft.com...
> Have you tried converting your WMF files into one of the supported
formats?
> The supported formats are bmp, jpg, gif, png and jpeg.
> Charles Kangai, MCT, MCDBA
> "Abdus Salam Atif" wrote:
> > Hello All,
> >
> > I am using Image control with database sourced images on my reports. The
> > images are stored in WMF format.
> >
> > There is no problem when the report is viewed in web browser but when I
> > export it as a PDF or TIFF, the images are not shown and a cross (X) is
> > shown instead of the image.
> >
> > Has anyone faced the same problem? Any help is solving this?
> >
> > Regards,
> > Atif
> >
> >
> >|||I have a similar situation, but rather than convert the images on the fly, I
convert the images in a batch and put back into the database. In my case the
images show correctly (PNG) in preview but not in HTML. If I export to PDF
they show ok. There seem to be others with this problem as well. I hope
someone from MS will address this issue because it is stopping me from
deploying RS is several situations.
Thanks.
"Abdus Salam Atif" <asalam@.xavor.com> wrote in message
news:eMS0MA60EHA.1408@.TK2MSFTNGP10.phx.gbl...
>I have also tried to convert the WMF files to PNG, which is the only
> accepted format for my application and web, this gives me a different
> behavior. The reports look fine in the preview and I am also able to
> generate a correct PDF from the preview window but not showing images when
> I
> open the report in the web browser.
> Regards,
> Atif
> "Charles Kangai" <CharlesKangai@.discussions.microsoft.com> wrote in
> message
> news:ABD7F597-8056-4BDA-B4B9-7D5E7A9DA017@.microsoft.com...
>> Have you tried converting your WMF files into one of the supported
> formats?
>> The supported formats are bmp, jpg, gif, png and jpeg.
>> Charles Kangai, MCT, MCDBA
>> "Abdus Salam Atif" wrote:
>> > Hello All,
>> >
>> > I am using Image control with database sourced images on my reports.
>> > The
>> > images are stored in WMF format.
>> >
>> > There is no problem when the report is viewed in web browser but when I
>> > export it as a PDF or TIFF, the images are not shown and a cross (X) is
>> > shown instead of the image.
>> >
>> > Has anyone faced the same problem? Any help is solving this?
>> >
>> > Regards,
>> > Atif
>> >
>> >
>> >
>
Wednesday, March 21, 2012
Problem with HTML slightly garbled sending email as web archive
sending a subscription via email in web archive format.
The report displays fine in the Report Manager. However, went emailed some
whitespace is seemingly randomly added to the HTML page. Depending on where
that whitespace is, this might not be a problem. But if the whitespace is
inserted in some places within an HTML tag, then the tag isn't rendered
properly.
Example: a space is added following the "<" in "</DIV>", thus giving "<
/DIV>". Since this is invalid HTML, it displays as text in the report.
Example: a cell in a table is defined as right-aligned and in a specific
font. All 25 rows in the table (x 3 columns = 75 cells) all display
correctly:
<P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
face="Eras Medium ITC" color=black size=2><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Eras
Medium ITC'">
*EXCEPT* one cell, where the following HTML is used:
<P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
style="FONT-SIZE: 12pt">
Why did RS render this cell differently?This might be an issue with the local SMTP. Are you using the pickup
directory to send email?
--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.
"Columbia Kai" <Columbia Kai@.discussions.microsoft.com> wrote in message
news:A0190874-9273-4F1C-9BD1-CF0CEB79616D@.microsoft.com...
> I'm experiencing a problem with HTML code being slightly messed up when
> sending a subscription via email in web archive format.
> The report displays fine in the Report Manager. However, went emailed
> some
> whitespace is seemingly randomly added to the HTML page. Depending on
> where
> that whitespace is, this might not be a problem. But if the whitespace is
> inserted in some places within an HTML tag, then the tag isn't rendered
> properly.
> Example: a space is added following the "<" in "</DIV>", thus giving "<
> /DIV>". Since this is invalid HTML, it displays as text in the report.
> Example: a cell in a table is defined as right-aligned and in a specific
> font. All 25 rows in the table (x 3 columns = 75 cells) all display
> correctly:
> <P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
> face="Eras Medium ITC" color=black size=2><SPAN
> style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Eras
> Medium ITC'">
> *EXCEPT* one cell, where the following HTML is used:
> <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
> style="FONT-SIZE: 12pt">
> Why did RS render this cell differently?|||Thanks for your reply, Daniel.
I've tried this with two SMTP mail servers, both with the same result. I
changed the definition via the RSReportServer.config file.
Neither SMTP server is on my local machine.
One resides on a Win2003 box and is a MS mail server; the other resides on a
Win2000 Server box and is a product called Merak Mail Server. Ultimately
they send via the Columbia University mail server, which is sendmail, I
believe.
(I'm not a systems guy so sorry if my answers aren't dead-on what you asked
for.)
Please also see my comments on another post title "Web archive subrsciption
gets messed up" (note misspelling of 'subscription'). I ran into an
identical problem like this when sending email from an Oracle PL/SQL program.
The resolution is to intersprese CRLF into the msg at least every 990 bytes.
Thanks Daniel. This is the one problem that's keeping me from implementing
RS and beginning to retire Crystal Enterprise.
"Daniel Reib [MSFT]" wrote:
> This might be an issue with the local SMTP. Are you using the pickup
> directory to send email?
> --
> -Daniel
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Columbia Kai" <Columbia Kai@.discussions.microsoft.com> wrote in message
> news:A0190874-9273-4F1C-9BD1-CF0CEB79616D@.microsoft.com...
> > I'm experiencing a problem with HTML code being slightly messed up when
> > sending a subscription via email in web archive format.
> >
> > The report displays fine in the Report Manager. However, went emailed
> > some
> > whitespace is seemingly randomly added to the HTML page. Depending on
> > where
> > that whitespace is, this might not be a problem. But if the whitespace is
> > inserted in some places within an HTML tag, then the tag isn't rendered
> > properly.
> >
> > Example: a space is added following the "<" in "</DIV>", thus giving "<
> > /DIV>". Since this is invalid HTML, it displays as text in the report.
> >
> > Example: a cell in a table is defined as right-aligned and in a specific
> > font. All 25 rows in the table (x 3 columns = 75 cells) all display
> > correctly:
> > <P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
> > face="Eras Medium ITC" color=black size=2><SPAN
> > style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Eras
> > Medium ITC'">
> > *EXCEPT* one cell, where the following HTML is used:
> > <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
> > style="FONT-SIZE: 12pt">
> > Why did RS render this cell differently?
>
>|||I haven't done this yet but what was suggested to me (I too am having
problems and am using an external smtp server too) was to use Windows 2003
smtp service and have it forward/route (not sure the term) to the external
smtp server. The Windows 2003 smtp server is configured to be looking at a
directory and forwarding things on from there. Then you have your report
saved to the pickup directory. Note that I haven't done this so I am a
little vague on how it all works.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Columbia Kai" <ColumbiaKai@.discussions.microsoft.com> wrote in message
news:8995F878-CB68-4766-BB00-654D7580BAF1@.microsoft.com...
> Thanks for your reply, Daniel.
> I've tried this with two SMTP mail servers, both with the same result. I
> changed the definition via the RSReportServer.config file.
> Neither SMTP server is on my local machine.
> One resides on a Win2003 box and is a MS mail server; the other resides on
> a
> Win2000 Server box and is a product called Merak Mail Server. Ultimately
> they send via the Columbia University mail server, which is sendmail, I
> believe.
> (I'm not a systems guy so sorry if my answers aren't dead-on what you
> asked
> for.)
> Please also see my comments on another post title "Web archive
> subrsciption
> gets messed up" (note misspelling of 'subscription'). I ran into an
> identical problem like this when sending email from an Oracle PL/SQL
> program.
> The resolution is to intersprese CRLF into the msg at least every 990
> bytes.
> Thanks Daniel. This is the one problem that's keeping me from
> implementing
> RS and beginning to retire Crystal Enterprise.
>
> "Daniel Reib [MSFT]" wrote:
>> This might be an issue with the local SMTP. Are you using the pickup
>> directory to send email?
>> --
>> -Daniel
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Columbia Kai" <Columbia Kai@.discussions.microsoft.com> wrote in message
>> news:A0190874-9273-4F1C-9BD1-CF0CEB79616D@.microsoft.com...
>> > I'm experiencing a problem with HTML code being slightly messed up when
>> > sending a subscription via email in web archive format.
>> >
>> > The report displays fine in the Report Manager. However, went emailed
>> > some
>> > whitespace is seemingly randomly added to the HTML page. Depending on
>> > where
>> > that whitespace is, this might not be a problem. But if the whitespace
>> > is
>> > inserted in some places within an HTML tag, then the tag isn't rendered
>> > properly.
>> >
>> > Example: a space is added following the "<" in "</DIV>", thus giving "<
>> > /DIV>". Since this is invalid HTML, it displays as text in the report.
>> >
>> > Example: a cell in a table is defined as right-aligned and in a
>> > specific
>> > font. All 25 rows in the table (x 3 columns = 75 cells) all display
>> > correctly:
>> > <P class=MsoNormal style="TEXT-ALIGN: right" align=right><FONT
>> > face="Eras Medium ITC" color=black size=2><SPAN
>> > style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY:
>> > 'Eras
>> > Medium ITC'">
>> > *EXCEPT* one cell, where the following HTML is used:
>> > <P class=MsoNormal><FONT face="Times New Roman" size=3><SPAN
>> > style="FONT-SIZE: 12pt">
>> > Why did RS render this cell differently?
>>sql
Problem with HTML rendering
I'm facing a problem when i render a report in HTML format.
When i see the report in the preview section of the report designer it
is perfect as desired.
After deployment, when i export the report in HTML format there are a
lot of white spaces inserted vertically. But it doesn't happen when it
is exported in PDF format.
Please suggest some methods to overcome this problem.
Thanks in advance
PrathimaTry to place your report elements and regions in rectangles to keep them
together.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"Prathima" <prathima.chandramouli@.gmail.com> wrote in message
news:f941b84.0411010245.4e3e8a9@.posting.google.com...
> Hi
> I'm facing a problem when i render a report in HTML format.
> When i see the report in the preview section of the report designer it
> is perfect as desired.
> After deployment, when i export the report in HTML format there are a
> lot of white spaces inserted vertically. But it doesn't happen when it
> is exported in PDF format.
> Please suggest some methods to overcome this problem.
> Thanks in advance
> Prathima
Tuesday, March 20, 2012
Problem with formatting with CR and LF in a string
I'm trying to use carriage return (CR) and line feed (LF) to format a string for use with the msdb.dbo.sp_send_dbmail stored procedure. My goal is to have several lines of text delineated with CR LF. However, it appears that SQL Server 2005 is replacing the CR LF with 2 spaces. The snipped below demonstrates this.
declare @.msg nVarChar(100)
set @.msg = 'this is before the cr ' + char(10) + char(11) + char(12) + char(13) + char(14) + char(10) + 'and this is after the cr'
select @.msg
If I copy the text returned by the select into a hex editor what I see for the portion of the string "cr ' + char(10) + char(11) + char(12) + char(13) + char(14) + char(10) + 'a" is:
63 72 20 20 0B 0C 20 0E 0F 61
I was expecting:
63 72 20 0A 0B 0C 0D 0E 20 61
This is what leads me to believe the CR and LF are being replaced with spaces as it shows hex 20 (SPACE) instead of hex 0A (LF) and hex 0D (CR).
Can someone explain to me how to make this do what I want it to?
Thanks
John
Given this simple test:
CREATE TABLE dbo.CRLF(id int,crlf nvarchar(100))
DECLARE @.msg nVarChar(100)
SET @.msg = 'this is before the cr ' + char(10)+ char(13) +'and this is after the cr'
INSERT INTO dbo.CRLF(id,crlf)VALUES(1, @.msg )
SELECT * FROM dbo.CRLF
I get this if I copy the results from Query Editor:
idcrlf
1this is before the crand this is after the cr
And this ouput put if I Open Table in Object Explorer:
1this is before the cr
and this is after the cr
|||I'm unable to duplicate your results. I get a single line when opening the table in the Object Explorer.If you add a DECLARE @.LongMsg and set @.LongMsg = @.Msg + @.Msg + @.Msg and then use @.LongMsg as the @.body parameter of the msdb.dbo.sp_send_dbmail your email will be a single long line with no CR LF showing in the text. This is basically what I'm trying to do.
Perhaps there is a server setting somewhere that needs to be tweaked on our server.
John|||
Ya it true but you see 2 box kind of symbol when you opened
the table trough Object explore, select the option “Result to Text” in the
Query panel and select the row then output shows like this.
(1 row(s)
affected)
idcrlf
--
1This is 1 msg
and this is
2 msg
this is 3
msg
(1 row(s)
affected)
|||Ok, after changing the option I can see the CR in the results. Thanks for showing me something I didn't know.However, I'm still having problems with the CR in the email text. Here's another snippit from the stored procedure:
Declare @.Message varchar(200)
Declare @.MessageList varChar(max)
SET @.MessageList = 'Daily Summary Report' + @.CR
SET @.MessageList = @.MessageList+'New Items'+ @.CR
SET @.MessageList = @.MessageList+'--'+ @.CR
DECLARE c2 CURSOR FOR
select MSG from Email.Messages
where Event_ID = @.EventID
OPEN c2
FETCH NEXT FROM c2
INTO @.Message
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.MessageList = @.MessageList + @.Message + @.CR
FETCH NEXT FROM c2
INTO @.Message
END
CLOSE c2
DEALLOCATE c2
This builds the body text of the email in the variable @.MessageList. It always puts a CR at the end of the line for the SET @.MessageList lines that are outside of the loop.
Inside the loop, if the message type has messages like "Added UPC 123456123456" it works fine with a CR at the end of every line.
If the message type has messages like "FAILED Client1 20050122 Source TYPE 2: 12 COLUMNS SEMI COLON DELIMITED production" it does not put a CR at the end of each line. If I put CR twice at the end of the line I do get two CR's in the email.
I'm stumped. At this point I have put in an if statement to put 2 CR's at the end of the event types that are not gettting the single CR and that seems to work, but I'm one of those types that like to understand why things work or don't work.
Any more thoughts? And thanks for your help.
John|||
Hmmm, I tried deleting a post I just made in this thread, because it seemed no longer relevant after John had made a simultaneous post, and it appears to have deleted John's new post, too.
I think that is a bug in the FORUM software, since I chose only my post when I selected "Delete".
Sorry!
Dan
Problem with Format() Function in expression
I have a textbox with an expression to format integer data:
="HH: " + format(Fields!ANZHH.Value,"#.###.") + ", EW: " +
format(Fields!ANZEW.Value,"#.###.")
I want that integer values appear as: HH: 1.000, EW: 3.890
("." = group digit )
However the custom format style that I use does not return the expected
result, instead RS shows HH: 1000, EW: 3890
Any ideas how to troubleshoot?
--
Thanks in advance
BodoI finally got it solved:
1) modified expression to:
="HH: " + format(Fields!ANZHH.Value,"#,###.") + ", EW: " +
format(Fields!ANZEW.Value,"#,###.")
2) set report property Language to Default.
As a result values are formated in the culture specified in IE language
settings.
Bodo|||I'm guessing I'm not the first to ask this, but haven't found anything
either here or via googling around.
Per the subject, some of our database fields have html code in them that we
would like to render inside the report (using the table control) as actual
html instead of just code, is this at all possible with some toggles or
perhaps expression injection? Its mostly stuff like fonts colors/sizes/etc,
nothing drastic, but of course its showing up as a bunch of
<this><that>...etc rathern than actual html.
Please let me know either way, or perhaps point me to an example somewhere?
TIA.
andy|||Apologies for the above :(
"Andrzej E. Raczynski" <andy@.aea13.org> wrote in message
news:9CA7AD98-7309-4C21-B000-46E7CDFD429C@.microsoft.com...
> I'm guessing I'm not the first to ask this, but haven't found anything
> either here or via googling around.
> Per the subject, some of our database fields have html code in them that
> we would like to render inside the report (using the table control) as
> actual html instead of just code, is this at all possible with some
> toggles or perhaps expression injection? Its mostly stuff like fonts
> colors/sizes/etc, nothing drastic, but of course its showing up as a bunch
> of <this><that>...etc rathern than actual html.
> Please let me know either way, or perhaps point me to an example
> somewhere?
> TIA.
> andy
Problem with format of DateTime parameter
Our machines have an Australian/English locale which as a date order of
Day/Month/Year.
I am using SQL RS 2005.
When I add a parameter of type DateTime and then preview the report a
strange thing happens.
* Use an Australian machine locale
* Create a dataset with no SQL. The dataset is just
SELECT @.MyDateParm
* Create a simple layout that uses this dataset
* Preview the report. You should get the nice date selection dialog.
* Select 1st December 2005
* View the report - It switches magically to 12th January 2005
* View again - it switches back etc..
Now what is going on here?
(Professor Julius Sumner Miller)
(I know my likely solution is to move to the USA - or at least change
my locale :)Has anyone ever encountered this problem?
I think it is a bug in RS2005.
Does anyone know how I could report this?
Thanks
RBot wrote:
> I am in Australia.
> Our machines have an Australian/English locale which as a date order of
> Day/Month/Year.
> I am using SQL RS 2005.
> When I add a parameter of type DateTime and then preview the report a
> strange thing happens.
> * Use an Australian machine locale
> * Create a dataset with no SQL. The dataset is just
> SELECT @.MyDateParm
> * Create a simple layout that uses this dataset
> * Preview the report. You should get the nice date selection dialog.
> * Select 1st December 2005
> * View the report - It switches magically to 12th January 2005
> * View again - it switches back etc..
> Now what is going on here?
> (Professor Julius Sumner Miller)
> (I know my likely solution is to move to the USA - or at least change
> my locale :)|||Well there are other people having problems with Date type parameters:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=150&messageid=286639
but where should I report this so it can be fixed?
Monday, March 12, 2012
problem with exports
HI
I was trying to export a report which i created in sql 2005 businees studio to excel..the problem is that the report is in drill down format and excel doesnt show the information quiete well when i export it to excel..i really need the drill down version to b exported in excel...wat shall i do?
The Excel rendering extension handles drilldowns by writing hyperlinks in worksheet cells. The content of the drilldown report does not appear in the output of the main report.
-Chris
|||hi Chris,
what you mean by the report does not appear in the output of the main report?
is that mean we need to create multiple report and then export them into excel for each page. then only use hyperlink to link all the report to show it have the effect of drill down?
problem with exports
HI
I was trying to export a report which i created in sql 2005 businees studio to excel..the problem is that the report is in drill down format and excel doesnt show the information quiete well when i export it to excel..i really need the drill down version to b exported in excel...wat shall i do?
The Excel rendering extension handles drilldowns by writing hyperlinks in worksheet cells. The content of the drilldown report does not appear in the output of the main report.
-Chris
|||hi Chris,
what you mean by the report does not appear in the output of the main report?
is that mean we need to create multiple report and then export them into excel for each page. then only use hyperlink to link all the report to show it have the effect of drill down?
Saturday, February 25, 2012
Problem with datetime expression
=IIF(Fields!Opened.Value="No","No",Format(Fields!Opened.Value,"yyyy-MM-dd
HH:mm:ss"))
The result I recieve when there is supposed to be a date is the date
mask (yyyy-MM-dd HH:mm:ss) instead of the actual value of the date.
Any ideas?
Best regards,
Peter!On Dec 7, 7:17 am, Peter Larsson <scape...@.hotmail.com> wrote:
> I have the following expression in a textbox in a table based on a dataset:
> =IIF(Fields!Opened.Value="No","No",Format(Fields!Opened.Value,"yyyy-MM-dd
> HH:mm:ss"))
> The result I recieve when there is supposed to be a date is the date
> mask (yyyy-MM-dd HH:mm:ss) instead of the actual value of the date.
> Any ideas?
> Best regards,
> Peter!
I assume that Fields!Opened.Value is a string value (because you are
using it twice there) that either contains the text "No" or a Date.
Try wrapping the second Value in a CDate() function to force a
conversion to DateTime. If the Format command is fed a value that it
can't convert, it returns the formatting string, not the value.
= IIF( Fields!Opened.Value = "No", "No", Format( CDate(Fields!
Opened.Value), "yyyy-MM-dd HH:mm:ss") )
-- Scott|||Orne wrote:
> On Dec 7, 7:17 am, Peter Larsson <scape...@.hotmail.com> wrote:
>> I have the following expression in a textbox in a table based on a dataset:
>> =IIF(Fields!Opened.Value="No","No",Format(Fields!Opened.Value,"yyyy-MM-dd
>> HH:mm:ss"))
>> The result I recieve when there is supposed to be a date is the date
>> mask (yyyy-MM-dd HH:mm:ss) instead of the actual value of the date.
>> Any ideas?
>> Best regards,
>> Peter!
> I assume that Fields!Opened.Value is a string value (because you are
> using it twice there) that either contains the text "No" or a Date.
> Try wrapping the second Value in a CDate() function to force a
> conversion to DateTime. If the Format command is fed a value that it
> can't convert, it returns the formatting string, not the value.
> = IIF( Fields!Opened.Value = "No", "No", Format( CDate(Fields!
> Opened.Value), "yyyy-MM-dd HH:mm:ss") )
> -- Scott
Hi Scott!
Thanks for the tip, now the date works but I get the #Error on the When
the value contains "No".
/Peter|||On Dec 7, 11:05 am, Peter Larsson <scape...@.hotmail.com> wrote:
> Orne wrote:
> > On Dec 7, 7:17 am, Peter Larsson <scape...@.hotmail.com> wrote:
> >> I have the following expression in a textbox in a table based on a dataset:
> >> =IIF(Fields!Opened.Value="No","No",Format(Fields!Opened.Value,"yyyy-MM-dd
> >> HH:mm:ss"))
> >> The result I recieve when there is supposed to be a date is the date
> >> mask (yyyy-MM-dd HH:mm:ss) instead of the actual value of the date.
> >> Any ideas?
> >> Best regards,
> >> Peter!
> > I assume that Fields!Opened.Value is a string value (because you are
> > using it twice there) that either contains the text "No" or a Date.
> > Try wrapping the second Value in a CDate() function to force a
> > conversion to DateTime. If the Format command is fed a value that it
> > can't convert, it returns the formatting string, not the value.
> > = IIF( Fields!Opened.Value = "No", "No", Format( CDate(Fields!
> > Opened.Value), "yyyy-MM-dd HH:mm:ss") )
> > -- Scott
> Hi Scott!
> Thanks for the tip, now the date works but I get the #Error on the When
> the value contains "No".
> /Peter- Hide quoted text -
> - Show quoted text -
Ok, just made some test data. I think that the second half of the IIF
statement is still being evaluated, and for those rows where the value
is "No", the CDate is failing, therefore the whole IIF is failing.
So, before we do the CDate, we have to check again if the value is a
non-convertable date, then if it is not convertable, set it to
Nothing. CDate(Nothing) is still Nothing, so then the second half of
the IIF would succeed.
The following works the way I think you want it to:
=IIF( Fields!Opened.Value = "No", "No", Format( CDate( IIF(Fields!
Opened.Value = "No", Nothing, Fields!Opened.Value) ), "yyyy-MM-dd
HH:mm:ss" ) )
-- Scott
Monday, February 20, 2012
Problem with dates format passed as parameters...
I am having the "classical problem" of the forums; A local date changed to the american format (normally in the development environment) which I call "Switching months with days"... well it switches both again if you press "view report" again :)
The problem I'm having is that when I Navigate from one report to other, the dates get switched...
Everything's been set in the locale uk date format (dd/mm/aaaa), in the operating system, in the database and in the reports... and the reports are working properly through the web interface.. the only thing that is not working properly is the Navigation which switches the date month with the day...
Changing all the Reporting Services server, database server to the american format date is not an acceptable solution.
Thanks for any guidance on this, as I'm pretty lost...
Jose
where are you switching the dates.
may be create and set a workflag and set it to 0 or 1
based if its 1 dont do anything if its 0 switch the dates to american format. so even if the user clicks the view report again, it will check for 1 and does nothing.
Thanks
Kishore.
|||Hi Raja,Thanks for your help, I'll try to explain what you ask:
I have a report with two parameters :
BeginningDate|||Try using string instead of datetime parameter, formatted as yyyyMMdd.
This is something like Convert(varchar(8),mydate,112)
Here is a good link with examples in SQL.
http://databases.aspfaq.com/database/what-are-the-valid-styles-for-converting-datetime-to-string.html
In Reporting Services you would use the Format function. eg. Format(MyDate, "yyyyMMdd")
cheers,
Andrew|||Hi!
That would work if the report wasn't called directly from the user, then, with that approach we are unable to present him the data selector, so he will have to write down the date this way... that is not acceptable by my client...
If the report was accessible only through the Navigation Link your approach would work wonderfully...
The point is how to make dates work right in other languages in SQL Server 2005 Reporting Services.... we are at the 2nd Service pack and it still doesn't work properly.. sigh...
Have to say that I have tried everything here, changing the user that executes the reporting services service, the database language, the system locale, the web.config locale, the report, table and all is set to spain (spain) and still it twists the date when we pass it as a paremeter
"13/02/2006" to "02/13/2006" , giving the properly errors, though...
Well, any help on this?
Thanks!!!
Jose
Problem with date format
I have a string with date parameters. Those date contains Hours/Minute/Second and i juste want the date without the time. So i have tried this:
=Format(Parameters!StartDate.Value, "d") & " to" & Format(Parameters!EndDate.Value, "d")
But this return me:
d to d
What i want is something like this 2000-01-01 to 2006-01-01
How can i do this ?
Thanks
What are the data types for parameters StartDate and EndDate? Can you make sure they are of datetime type, not string?|||
Thank for your answer. You're right. Those dates come from parameters so they were in string... i've put a CDATE before the FORMAT and now it's working fine.
Thanks !
Problem with DATE FORMAT
I put in my report a formula field, I want that MyDate is formatted as dd-mm-yyyy , i've tried a lot of solutions but when i launch the report from a vb application i get the error "20515: E' necessaria una data" (a data field is required)
But... the original field is a date!!! I don't understand what's the problem , could you help me?
I'm using Crystal Report 6.0 and Visual Basic 6.0Hi,
Can you post the code used in the Formula filed?
Madhivanan|||Try using the Convert in your formula field: CDate({FieldName})
Also, the end result of a formula field must be only 1 data type. Example: 'The Date is: ' & {DateField} is trying to concatenate a string and a date, Crystal doesn't like that. In order to avoid an error in this case, you would need to convert the Date to a string. If you did that, you would have no control over the Format of the date. In this case, you can set the Report's default Date Format to what you need (For CR 8.5, it located under Designer, Default Settings, click the Fields tab, then the Date button or Date/Time button).
How are you getting the Field to Crystal Reports? Make sure that it's passing the correct variable type. You may be getting the error because the date field is getting passed in as a string.|||I'm passing a smalldata field!
In my db is "2004-11-10 00:00:00.000", I want to view "10-11-2004" but i can't do it.
I don't understand how to format it right :-\|||I'm passing a smalldata field!
In my db is "2004-11-10 00:00:00.000", I want to view "10-11-2004" but i can't do it.
I don't understand how to format it right :-\
do u know VB.net...if yes do u mind helpin me :confused: please lemme know...
thanks!|||I know VB|||I have not looked at this in detail, but just check the data type - Crystal has both Date and DateTime fields, and the field you are using looks like a DateTime, not a date.
Dave|||Hi Surrender79, Try this. Create a formula filed having the following code
replace(totext(cdate({DateField})),"/","-")
and place it in the details section. Now you can see what you expected
Madhivanan|||:(
I've put my date (smalldate type) in a formula field as below:
ToText(Day ({MYDATE}),0)
+ "-" +
ToText(Month ({MYDATE}),0)
+ "-" +
ToText(Year ({MYDATE}),"####")
If I launch the report directly from Crystal Report preview I got the right date but when I call the report preview from VB automation, I got the error "A data field is required" ____
I've CR6, some of your suggest are not good in my reports.
Thanks anyway
Ciao :)|||Hi Surrender79, did you get any error in executing replace(totext(cdate({DateField})),"/","-")
Madhivanan|||Yes, It doesn't recognize the command "replace" and "cdate", infact in my crystal report I haven't those options :(|||In menu file "Opzioni Report" (Report Option) there's "Converti campo data/ora" (Convert date/time field).
Default setting is "Stringa" (String), so I've setted "Date".
But now... i've a other question: how could I edit the report settings from vb code?
Problem with date
'14/10/2004', instead of writing the following query?
select rtrim(ltrim(cast(DATEPART(m, GETDATE()) as char)))+ '/'+
rtrim(ltrim(cast(DATEPART(d, GETDATE()) as char))) + '/' +
rtrim(ltrim(cast(DATEPART(yy, GETDATE()) as char)))
as dato from dummy
Thank you!
Federica"Federica T" <fedina_chicca@.N_O_Spam_libero.it> wrote in message
news:ckltfm$bab$1@.atlantis.cu.mi.it...
> Is there a shorter (an easier) way to obtain a date in this format
> '14/10/2004', instead of writing the following query?
> select rtrim(ltrim(cast(DATEPART(m, GETDATE()) as char)))+ '/'+
> rtrim(ltrim(cast(DATEPART(d, GETDATE()) as char))) + '/' +
> rtrim(ltrim(cast(DATEPART(yy, GETDATE()) as char)))
> as dato from dummy
> Thank you!
> Federica
See CONVERT() in Books Online:
select convert(char(10), getdate(), 103)
Or you can format dates in the client application - it can be easier to
provide the correct regional formatting for different clients that way. You
might not need to be able to do that in your situation, of course.
Simon|||> See CONVERT() in Books Online:
> select convert(char(10), getdate(), 103)
> Or you can format dates in the client application - it can be easier to
> provide the correct regional formatting for different clients that way.
You
> might not need to be able to do that in your situation, of course.
> Simon
Thank you, Simon!