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

Tuesday, March 27, 2012

Change from Crystal Reports to SQL Server 2005 Reporting Services?

Hi all,
We have a web application that generates statistical reports in PDF format
based on customer data and we're thinking of migrating to SQL Server 2005
Reporting Services but I'd like to know if what we are doing is possible.
Basically, the customer logs onto the system via a regular browser, this
creates a folder on the backend based on their session info. Then they
select a couple of different reports, enter the required parameters and hit
print. The web app runs a VB program that loads the RPT file, modifies the
connections so it's getting the data from the correct customer database,
then exports the report as a PDF into the previously created folder. The
user is then redirected to that file so they can download it.
Whether the report is shown in a browser window or not is all dependent on
the customers settings for PDF documents. We don't need interactive
web-based reports, we don't need to drill-down, we don't need OLAP. It's a
simple "I want a report", "Here it is" scenario, but there is the definate
potential of having several hundred customers all requesting reports at the
same time, which is something our current solution can't handle.
Comments and suggestions are welcome.2005 has the ability to change the datasource at runtime. You do not need to
do any of this creating a folder in the background etc. Everything that you
want is really very simple.When your web app renders it can request it as
PDF. Also, you can send the report a parameter and based on that parameter
pick the appropriate database.
Implementing your security is the biggest issue (and what comes up the most
with an internet application). You will need to do forms based
authentication (which I have not done and do not know much about).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Andrew Hayes" <AndrewHayes@.discussions.microsoft.com> wrote in message
news:OOzh8DapGHA.4408@.TK2MSFTNGP04.phx.gbl...
> Hi all,
> We have a web application that generates statistical reports in PDF format
> based on customer data and we're thinking of migrating to SQL Server 2005
> Reporting Services but I'd like to know if what we are doing is possible.
> Basically, the customer logs onto the system via a regular browser, this
> creates a folder on the backend based on their session info. Then they
> select a couple of different reports, enter the required parameters and
> hit print. The web app runs a VB program that loads the RPT file, modifies
> the connections so it's getting the data from the correct customer
> database, then exports the report as a PDF into the previously created
> folder. The user is then redirected to that file so they can download it.
> Whether the report is shown in a browser window or not is all dependent on
> the customers settings for PDF documents. We don't need interactive
> web-based reports, we don't need to drill-down, we don't need OLAP. It's a
> simple "I want a report", "Here it is" scenario, but there is the definate
> potential of having several hundred customers all requesting reports at
> the same time, which is something our current solution can't handle.
> Comments and suggestions are welcome.
>|||Thanks for the reply Bruce. Application security is already handled.
Maybe you can guide me through my understanding of how SSRS would handle
this?
a) User opens web-page.
b) User selects report from drop-down list, and the postback shows the
correct parameter options.
c) User enters the parameter values he needs.
d) User clicks on print.
e) Pop-up appears asking the user to wait while their report is prepared.
f) A few minutes later, the pop-up disappears to be replaced by the usual
File Download dialog.
g) User clicks Save and the PDF is saved to their PC.
We can do this in Crystal Reports without any fuss, but when more than 30
users are performing the same actions at the same time, the queue of report
requests ends up being pretty large as it takes quite some time to produce
each report. We're hoping that SSRS will let us "farm" out the report
generation to multiple servers.
"Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
news:OJlmwOcpGHA.3324@.TK2MSFTNGP05.phx.gbl...
> 2005 has the ability to change the datasource at runtime. You do not need
> to do any of this creating a folder in the background etc. Everything that
> you want is really very simple.When your web app renders it can request it
> as PDF. Also, you can send the report a parameter and based on that
> parameter pick the appropriate database.
> Implementing your security is the biggest issue (and what comes up the
> most with an internet application). You will need to do forms based
> authentication (which I have not done and do not know much about).
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "Andrew Hayes" <AndrewHayes@.discussions.microsoft.com> wrote in message
> news:OOzh8DapGHA.4408@.TK2MSFTNGP04.phx.gbl...
>> Hi all,
>> We have a web application that generates statistical reports in PDF
>> format based on customer data and we're thinking of migrating to SQL
>> Server 2005 Reporting Services but I'd like to know if what we are doing
>> is possible.
>> Basically, the customer logs onto the system via a regular browser, this
>> creates a folder on the backend based on their session info. Then they
>> select a couple of different reports, enter the required parameters and
>> hit print. The web app runs a VB program that loads the RPT file,
>> modifies the connections so it's getting the data from the correct
>> customer database, then exports the report as a PDF into the previously
>> created folder. The user is then redirected to that file so they can
>> download it.
>> Whether the report is shown in a browser window or not is all dependent
>> on the customers settings for PDF documents. We don't need interactive
>> web-based reports, we don't need to drill-down, we don't need OLAP. It's
>> a simple "I want a report", "Here it is" scenario, but there is the
>> definate potential of having several hundred customers all requesting
>> reports at the same time, which is something our current solution can't
>> handle.
>> Comments and suggestions are welcome.
>>
>|||Although implemented in a different way, the scenario described below is no
problem. RS has support for web farms. The Reporting Services app (which is
a 2.0 dotnet application) can run on a web farm. They all use the same
backend database for object/metadata caching. You do have to purchase a SQL
Server 2005 server license for each box running
PDF processing is more resource intensive than html or csv but RS 2005 has
improved this over RS 2000.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Andrew Hayes" <AndrewHayes@.discussions.microsoft.com> wrote in message
news:eqzqBohpGHA.1548@.TK2MSFTNGP04.phx.gbl...
> Thanks for the reply Bruce. Application security is already handled.
> Maybe you can guide me through my understanding of how SSRS would handle
> this?
> a) User opens web-page.
> b) User selects report from drop-down list, and the postback shows the
> correct parameter options.
> c) User enters the parameter values he needs.
> d) User clicks on print.
> e) Pop-up appears asking the user to wait while their report is prepared.
> f) A few minutes later, the pop-up disappears to be replaced by the usual
> File Download dialog.
> g) User clicks Save and the PDF is saved to their PC.
> We can do this in Crystal Reports without any fuss, but when more than 30
> users are performing the same actions at the same time, the queue of
> report requests ends up being pretty large as it takes quite some time to
> produce each report. We're hoping that SSRS will let us "farm" out the
> report generation to multiple servers.
> "Bruce L-C [MVP]" <bruce_lcNOSPAM@.hotmail.com> wrote in message
> news:OJlmwOcpGHA.3324@.TK2MSFTNGP05.phx.gbl...
>> 2005 has the ability to change the datasource at runtime. You do not need
>> to do any of this creating a folder in the background etc. Everything
>> that you want is really very simple.When your web app renders it can
>> request it as PDF. Also, you can send the report a parameter and based on
>> that parameter pick the appropriate database.
>> Implementing your security is the biggest issue (and what comes up the
>> most with an internet application). You will need to do forms based
>> authentication (which I have not done and do not know much about).
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "Andrew Hayes" <AndrewHayes@.discussions.microsoft.com> wrote in message
>> news:OOzh8DapGHA.4408@.TK2MSFTNGP04.phx.gbl...
>> Hi all,
>> We have a web application that generates statistical reports in PDF
>> format based on customer data and we're thinking of migrating to SQL
>> Server 2005 Reporting Services but I'd like to know if what we are doing
>> is possible.
>> Basically, the customer logs onto the system via a regular browser, this
>> creates a folder on the backend based on their session info. Then they
>> select a couple of different reports, enter the required parameters and
>> hit print. The web app runs a VB program that loads the RPT file,
>> modifies the connections so it's getting the data from the correct
>> customer database, then exports the report as a PDF into the previously
>> created folder. The user is then redirected to that file so they can
>> download it.
>> Whether the report is shown in a browser window or not is all dependent
>> on the customers settings for PDF documents. We don't need interactive
>> web-based reports, we don't need to drill-down, we don't need OLAP. It's
>> a simple "I want a report", "Here it is" scenario, but there is the
>> definate potential of having several hundred customers all requesting
>> reports at the same time, which is something our current solution can't
>> handle.
>> Comments and suggestions are welcome.
>>
>>
>

Sunday, March 25, 2012

Change Format of Dates

I don't know why my company did this, but dates are being stored in a char field within our database. Meanwhile, I've been setting up new pages using datetime.

That's just a little back story. My question is, is it possible to change the format of all dates in the table from yyyy/MM/dd to MM/dd/yyyy in the char field? I'm just trying to think of an easier way to change a thousand or so records instead of doing it manually.

Thanks.

Try this:

string temp ="2006/12/16";
string[] field = temp.Split(("/").ToCharArray());
string reversedate = field[2] +"/" + field[1] +"/" + field[0];
DateTime newdate = DateTime.Parse(reversedate);


|||

Or better still, run this SQL

Update table set newdatefield = parsename(replace(oldchardate, '/', '.'), 2) + '/' + parsename(replace(oldchardate, '/', '.'), 1) + '/' + parsename(replace(oldchardate, '/', '.'), 3)

|||

try this logic

print

convert(varchar(20),convert(datetime,'2002/02/23',111),101)

so you can just do update on your table date field content by

update YourTable
set datefield=convert(varchar(20),convert(datetime,datefield,111),101)

Thanks

|||

I ended up using this logic in a SQL statement:

datefield=right(datefield, 5)&'/'&left(datefield, 4)

sql

Change font size w/ expression?

Hi I have a chart whose title I would like to format w different font sizes.
The chart title is:
<caption>="This is the chart main text" + vbcrlf +
First(Fields!subtitle.Value, "Text")</caption>
The main chart title is hard coded and the second line is a field.
I would like to change the font size on that second line. Is there a way to
reference the <caption> line in <style><fontsize> and parse through it?
I'm thinking this isn't possible, but why not ask.
Thanks!
MarcusOn Nov 27, 3:56 pm, Marcus K <Marc...@.discussions.microsoft.com>
wrote:
> Hi I have a chart whose title I would like to format w different font sizes.
> The chart title is:
> <caption>="This is the chart main text" + vbcrlf +
> First(Fields!subtitle.Value, "Text")</caption>
> The main chart title is hard coded and the second line is a field.
> I would like to change the font size on that second line. Is there a way to
> reference the <caption> line in <style><fontsize> and parse through it?
> I'm thinking this isn't possible, but why not ask.
> Thanks!
> Marcus
You will most likely want to create a custom ASP.NET application that
reads in the RDL file (possibly as an XML Document) and parses the XML
tags and writes the file back out -and/or- read the RDL file in via
Streamreader and assigns it to a string and then does a string replace
of the fontsize in the tags and then writes the file back out via
Streamwriter. Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||Thanks Enrique, but thats outside the scope of my knowledge.
Any chance there is a way to do it within the rdl?
"EMartinez" wrote:
> On Nov 27, 3:56 pm, Marcus K <Marc...@.discussions.microsoft.com>
> wrote:
> > Hi I have a chart whose title I would like to format w different font sizes.
> > The chart title is:
> >
> > <caption>="This is the chart main text" + vbcrlf +
> > First(Fields!subtitle.Value, "Text")</caption>
> >
> > The main chart title is hard coded and the second line is a field.
> >
> > I would like to change the font size on that second line. Is there a way to
> > reference the <caption> line in <style><fontsize> and parse through it?
> >
> > I'm thinking this isn't possible, but why not ask.
> >
> > Thanks!
> > Marcus
>
> You will most likely want to create a custom ASP.NET application that
> reads in the RDL file (possibly as an XML Document) and parses the XML
> tags and writes the file back out -and/or- read the RDL file in via
> Streamreader and assigns it to a string and then does a string replace
> of the fontsize in the tags and then writes the file back out via
> Streamwriter. Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>

Thursday, March 22, 2012

Change Default Filename with Export?

When I use URL Access to render a report with specified parameters and a
format (e.g. PDF), when I choose "Save" (instead of Open) the default
filename is listed as "ThisReportName.pdf". I need to have the "Save As"
name to be very specific (e.g. include the date and the customer ID, like
EN12345-9-27-07.pdf) and ready to save without any typing by the end-user.
I cannot find a URL parameter that will change the default filename (to be
saved) for an exported PDF. Is this possible with SSRS?
Thanks for any help or direction.On Sep 27, 12:10 pm, "Don Miller" <nos...@.nospam.com> wrote:
> When I use URL Access to render a report with specified parameters and a
> format (e.g. PDF), when I choose "Save" (instead of Open) the default
> filename is listed as "ThisReportName.pdf". I need to have the "Save As"
> name to be very specific (e.g. include the date and the customer ID, like
> EN12345-9-27-07.pdf) and ready to save without any typing by the end-user.
> I cannot find a URL parameter that will change the default filename (to be
> saved) for an exported PDF. Is this possible with SSRS?
> Thanks for any help or direction.
I believe that I answered this question in your other posting.
Regards,
Enrique Martinez
Sr. Software Consultant

Tuesday, March 20, 2012

Change dateformat

Hi Guys,
Is there any way by that we can change default format of date.
ThanksHi
Lookup SET DATEFORMAT command in the BOL.
"Manish Sukhija" <ManishSukhija@.discussions.microsoft.com> wrote in message
news:782D9F1F-B7DB-4C54-84BB-32E9ABACFA9A@.microsoft.com...
> Hi Guys,
> Is there any way by that we can change default format of date.
> Thanks|||Hi Uri,
I've already tried it, but it doesn't work, just have a look what i
wrote...
SET DATEFORMAT mdy
GO
DECLARE @.datevar datetime
SET @.datevar = '12/31/98'
SELECT @.datevar
send me some example, if you can
Thanks
"Uri Dimant" wrote:

> Hi
> Lookup SET DATEFORMAT command in the BOL.
>
> "Manish Sukhija" <ManishSukhija@.discussions.microsoft.com> wrote in messag
e
> news:782D9F1F-B7DB-4C54-84BB-32E9ABACFA9A@.microsoft.com...
>
>|||Oh, I think I understand what you need
Look you can change format of the GETDATE() function by using CONVERT
system function (look at BOL)
However if are going to display the date on the client side ,so it depends
on regional; setting of the workstation thus it is a good practice to use
FORMAT functuin (VB) to display the data in format you want
If it does not help you ,please explain what you are trying to accomplish
along with DDL+ sample data+ expected result
"Manish Sukhija" <ManishSukhija@.discussions.microsoft.com> wrote in message
news:EC5E0DC0-C9A8-435E-A333-4261B4AC23C1@.microsoft.com...
> Hi Uri,
> I've already tried it, but it doesn't work, just have a look what i
> wrote...
> SET DATEFORMAT mdy
> GO
> DECLARE @.datevar datetime
> SET @.datevar = '12/31/98'
> SELECT @.datevar
> send me some example, if you can
> Thanks
> "Uri Dimant" wrote:
>|||Hi uri,
i was thinking same which you told me, but now i'm feeling fine
that i've confermed from you, anyway thanks.
i noticed URI whenever i get into trouble
you always helped me, i admire you, but sometimes i need help urgent, so
could i have your e-mail address, sothat i can mail you directly.
Thanks
"Uri Dimant" wrote:

> Oh, I think I understand what you need
> Look you can change format of the GETDATE() function by using CONVERT
> system function (look at BOL)
> However if are going to display the date on the client side ,so it depend
s
> on regional; setting of the workstation thus it is a good practice to use
> FORMAT functuin (VB) to display the data in format you want
>
> If it does not help you ,please explain what you are trying to accomplish
> along with DDL+ sample data+ expected result
>
> "Manish Sukhija" <ManishSukhija@.discussions.microsoft.com> wrote in messag
e
> news:EC5E0DC0-C9A8-435E-A333-4261B4AC23C1@.microsoft.com...
>
>|||Manish
Thank you for your words , I prefer to answer throu this newsgroup anyway
you have may email when you click on relply to from my post.
"Manish Sukhija" <ManishSukhija@.discussions.microsoft.com> wrote in message
news:65E6D7A1-2467-48DC-A7B8-492AD3AF77CA@.microsoft.com...
> Hi uri,
> i was thinking same which you told me, but now i'm feeling fine
> that i've confermed from you, anyway thanks.
> i noticed URI whenever i get into
> trouble
> you always helped me, i admire you, but sometimes i need help urgent, so
> could i have your e-mail address, sothat i can mail you directly.
> Thanks
> "Uri Dimant" wrote:
>|||Uri Dimant is always helpful to others
Manish, why do you need changing the date format?
You should do the formation at Client side
Madhivanan|||is use this function.. works great..
CREATE FUNCTION [dbo].[FormatDateTime]
(
@.dDate datetime, --Date value to be formatted
@.sFormat varchar(200) --Format for date value
)
RETURNS varchar(200)
AS
BEGIN
/*
Description:
Formats a date to a specific format.
Parameters:
@.dDate datetime
A value or field of datatype datetime or a value or field that can be
explicitly converted to
a datetime datatype.
@.sFormat varchar(200)
Format codes using the characters described below
MMMM or DDDD = the full name for the day or month
MMM or DDD = the first 3 letters of the month or day
MM or DD = the two digit code signifying the month or day
M1 or D1 = the month or day value without a preceding zero
YYYY = a four digit year
YY = a two digit year
hh 2-digit hour 01, 02, ..., 12, 13, ..., 22, 23
nn 2-digit minute 01, 02, ..., 58, 59
ss 2-digit second 01, 02, ..., 58, 59
zzz 3-digit milliseconds 000, 001, ..., 998, 999
AM Use 12-hour (AM/PM) time format
All other characters will not be replaced such as / - . * # a b z x %
and
will show
up in the date in the same relative position that they appear in the
format
parameter.
Examples
select dbo.FormatDateTime('9/21/2001','dddd, mmmm d1, yyyy')
Friday, September 21, 2001
select dbo.FormatDate('9/21/2001','mm/dd/yyyy')
09/21/2001
select dbo.FormatDate('9/21/2001','mm-dd-yyyy')
09/21/2001
select dbo.FormatDate('9/21/2001','yyyymmdd')
20010921
select dbo.FormatDate('9/5/2001','m1/d1/yy')
9/5/01
select dbo.FormatDate('9/21/2001','mmm-yyyy')
Sep-2001
*/
-- Insert the Month
set @.sFormat = replace(@.sFormat,'MMMM',datename(month,@.
dDate))
set @.sFormat =
replace(@.sFormat,'MMM',convert(char(3),d
atename(month,@.dDate)))
set @.sFormat =
replace(@.sFormat,'MM',right(convert(char
(4),@.dDate,12),2))
set @.sFormat =
replace(@.sFormat,'M1',convert(varchar(2)
,convert(int,right(convert(char(4),@.
dDate,12),2))))
-- Insert the Day
set @.sFormat = replace(@.sFormat,'DDDD',datename(wday
,@.dDate))
set @.sFormat =
replace(@.sFormat,'DDD',convert(char(3),d
atename(wday,@.dDate)))
set @.sFormat =
replace(@.sFormat,'DD',right(convert(char
(6),@.dDate,12),2))
set @.sFormat =
replace(@.sFormat,'D1',convert(varchar(2)
,convert(int,right(convert(char(6),@.
dDate,12),2))))
-- Insert the Year
set @.sFormat = replace(@.sFormat,'YYYY',convert(char(4),
@.dDate,112))
set @.sFormat = replace(@.sFormat,'YY',convert(char(2),@.d
Date,12))
-- Insert Minutes, Seconds and Milliseconds
set @.sFormat = replace(@.sFormat, 'NN', RIGHT(CONVERT(char(16), @.dDate,
126), 2))
set @.sFormat = replace(@.sFormat, 'SS', RIGHT(CONVERT(char(19), @.dDate,
126), 2))
set @.sFormat = REPLACE(@.sFormat, 'ZZZ', RIGHT(CONVERT(char(24), @.dDate,
109), 3))
-- Check if the user wants 12-hour or 24-hour formatting
IF PATINDEX('%AM%', @.sFormat) > 0
BEGIN
/* 12-hour format (AM/PM) desired */
set @.sFormat = REPLACE(@.sFormat, 'HH',
CAST(CAST(RIGHT(CONVERT(char(14),
@.dDate, 0), 2) AS int) AS varchar(2)))
set @.sFormat = REPLACE(@.sFormat, 'AM', RIGHT(CONVERT(char(26),
@.dDate,
109), 2))
END
ELSE
BEGIN
/* 24-hour format desired */
set @.sFormat = REPLACE(@.sFormat, 'HH', DATEPART(hh, @.dDate))
END
RETURN @.sFormat
END|||On 19 Dec 2005 16:36:00 -0800, CJ wrote:

>is use this function.. works great..
Hi CJ,
But it comes at a price. It's much slower than using the normal string
handling and conversion functions.
I compared performance of your function against alternative code. The
test data was my calendar table, which holds all dates from 2000-01-01
up to and including 2029-12-31 (a total of 10958 rows).
I started with a basic test, using the YYYYMMDD format:
DECLARE @.start datetime
SET @.start = getdate()
SELECT dbo.FormatDateTime(c.dt, 'YYYYMMDD') AS x
INTO #dummy1
FROM dbo.Calendar AS c
SELECT DATEDIFF(ms, @.start, getdate())
go
DECLARE @.start datetime
SET @.start = getdate()
SELECT CONVERT(char(8), c.dt, 112) AS x
INTO #dummy2
FROM dbo.Calendar AS c
SELECT DATEDIFF(ms, @.start, getdate())
Both produce the exact same output (I select into a temp table to avoid
the overhead of sending data over a network and disaplying it on a
screen, but I did check the results later). With your function, elapsed
time was 1788 ms (average of two executions with hot cache); the regular
CONVERT function used 78 ms.
Next test was more complex: MMM-YYYY. The test script was basically
unchanged, except for these lines:
SELECT dbo.FormatDateTime(c.dt, 'MMM-YYYY') AS x
(...)
SELECT REPLACE(RIGHT(CONVERT(char(11), c.dt, 106), 8), ' ', '-') AS x
Test results: function used 1788 ms, expression with nested calls to
builtin functions took 102 ms.
Final test was very complicated: DDDD, MMMM D1, YYYY:
SELECT dbo.FormatDateTime(c.dt, 'DDDD, MMMM D1, YYYY') AS x
(...)
SELECT DATENAME(wday, c.dt) + ', '
+ DATENAME(month, c.dt) + ' '
+ RIGHT(CONVERT(char(12), c.dt, 107), 8) AS x
Function took 1850 ms; complex expression with builtins 110 ms.
The function you posted can be a great time-saver if you have little
time to write the code (though it's not exactly rocket science to
manipulate the date format using builtin functions). But don't ever use
it in time-critical queries!
Oh, and before I forget: formatting should better be handled on the
client! :-]
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Hi Hugo-
Yes.. It tried to answer the initial question and actually, I use this
when returning xml data via for XML EXPLICIT to avoid any extra
processing on the server but after seeing your numbers, I might be
scrapping it. FYI: This function was taken off the web so I don't
claim to be the author. ;)
Regards-
Thanks for your advice!

change date&time default formate to mm/dd/yyyy

dear

i've an old sql server 2000, with default date format mm/dd/yyyy

i've installed a new one SQL server 2005 , my application did't work with its date format

i wan't to change SQL 2005 default date format to mm/dd/yyyy instead of dd/mm/yyyy

regards

Dates are displayed as configured for the user (its a session setting). But formatting of the dates should be made in the front end / presentation layer. Don′t do that on the server, try to pass the date in a more generic format like ISO Date. 20061114

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de

Change Date Format of Field value

What is the best way of converting datatime field value 29/03/2005 08:58:27 to 29/03/2005.

I only want to remove Time from date and I am using Sql Server 2000.

Thanks

Arvind

Look at the cast and convert functions

I use cast(convert(varchar(10), getdate(), 101) as datetime)

sql

change date format from MMDDYYYY to DDMMYYY ?

Hi,
My report dates are coming out in the following format MM/DD/YYYY. How can I
change this to DD/MM/YYYY.
i.e is this to do with IIS, reporting services or the report itself ?
(machine is DD/MM/YYY)
Thanks
Scottscott wrote:
> Hi,
> My report dates are coming out in the following format MM/DD/YYYY.
How can I
> change this to DD/MM/YYYY.
> i.e is this to do with IIS, reporting services or the report itself ?
> (machine is DD/MM/YYY)
> Thanks
> Scott
In tools/options set International Settings to be same as Microsoft
Office.
Find Report object on the Properties window dropdown and set the
Language property to English (UK)
This should now allow you to set the format of the textbox to
dd/mm/yyyy or similar. (Go to property pages for some default options -
right click text box and go to properties.)|||thanks
scott

Change Date Format from mm/dd/yyyy to dd/mm/yyyy

Hi,
I have a query to retrieve data from a table for the give two dates(from and
to) in a stored procedure.
select * from employees where (DateJoined BETWEEN @.FromDate AND @.ToDate)
now I have give the dates like this to get the results
@.FromDate =01/01/2005(mm/dd/yyyy)
@.ToDate=6/2/2005(mm/dd/yyyy)
but I would like to give the date in this format (dd/mm/yyyy) like
@.FromDate =01/01/2005(dd/mm/yyyy)
@.ToDate=2/6/2005(dd/mm/yyyy)
can someone help me with this(I know there is a way in which you can specify
in select query itself, but forgot :-) )
Thanks
KiranWhy do you need to express the date in a special format? Why not let the end
user use the format the
end user want (based on regional settings) and let the application send a fo
rmat to SQL server which
is language neutral?
See http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Kiran" <kiran_nospam@.gmail.com> wrote in message news:Ot61f56ZFHA.3840@.tk2msftngp13.phx.gb
l...
> Hi,
> I have a query to retrieve data from a table for the give two dates(from a
nd to) in a stored
> procedure.
> select * from employees where (DateJoined BETWEEN @.FromDate AND @.ToDate)
> now I have give the dates like this to get the results
> @.FromDate =01/01/2005(mm/dd/yyyy)
> @.ToDate=6/2/2005(mm/dd/yyyy)
> but I would like to give the date in this format (dd/mm/yyyy) like
> @.FromDate =01/01/2005(dd/mm/yyyy)
> @.ToDate=2/6/2005(dd/mm/yyyy)
> can someone help me with this(I know there is a way in which you can speci
fy in select query
> itself, but forgot :-) )
> Thanks
> Kiran
>|||Kiran wrote:
> Hi,
> I have a query to retrieve data from a table for the give two
> dates(from and to) in a stored procedure.
> select * from employees where (DateJoined BETWEEN @.FromDate AND
> @.ToDate)
> now I have give the dates like this to get the results
> @.FromDate =01/01/2005(mm/dd/yyyy)
> @.ToDate=6/2/2005(mm/dd/yyyy)
> but I would like to give the date in this format (dd/mm/yyyy) like
> @.FromDate =01/01/2005(dd/mm/yyyy)
> @.ToDate=2/6/2005(dd/mm/yyyy)
> can someone help me with this(I know there is a way in which you can
> specify in select query itself, but forgot :-) )
> Thanks
> Kiran
Always use a portable date format in SQL... or else.
YYYYMMDD
or
YYYY-MM-DDThh:mm:ss.mmm
David Gugick
Quest Software
www.imceda.com
www.quest.com

Change date format

Hello.
How can I change (global) date format from yyyy-MM-dd to my custom format?
Thank you.
For input or output?
I suggest you read below article. You find your answers in it:
http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Dvali" <david_dvali@.hotmail.com> wrote in message
news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
> Hello.
> How can I change (global) date format from yyyy-MM-dd to my custom format?
> Thank you.
>
|||I want change it globally for whole SQL Server?
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OtEYGgBcFHA.3280@.TK2MSFTNGP09.phx.gbl...
> For input or output?
> I suggest you read below article. You find your answers in it:
> http://www.karaszi.com/SQLServer/info_datetime.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "David Dvali" <david_dvali@.hotmail.com> wrote in message
> news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
>
|||That didn't answer my question. There no such thing as a global setting for SQL Server datetime
format. You have to handle input in one way and output in another way. See my article, the first few
sections. It has all the answers and options.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Dvali" <david_dvali@.hotmail.com> wrote in message
news:%23v4GnkBcFHA.3400@.tk2msftngp13.phx.gbl...
>I want change it globally for whole SQL Server?
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:OtEYGgBcFHA.3280@.TK2MSFTNGP09.phx.gbl...
>

Change date format

Hello.
How can I change (global) date format from yyyy-MM-dd to my custom format?
Thank you.For input or output?
I suggest you read below article. You find your answers in it:
http://www.karaszi.com/SQLServer/info_datetime.asp
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Dvali" <david_dvali@.hotmail.com> wrote in message
news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
> Hello.
> How can I change (global) date format from yyyy-MM-dd to my custom format?
> Thank you.
>|||I want change it globally for whole SQL Server?
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OtEYGgBcFHA.3280@.TK2MSFTNGP09.phx.gbl...
> For input or output?
> I suggest you read below article. You find your answers in it:
> http://www.karaszi.com/SQLServer/info_datetime.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "David Dvali" <david_dvali@.hotmail.com> wrote in message
> news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
>> Hello.
>> How can I change (global) date format from yyyy-MM-dd to my custom
>> format?
>> Thank you.
>|||That didn't answer my question. There no such thing as a global setting for SQL Server datetime
format. You have to handle input in one way and output in another way. See my article, the first few
sections. It has all the answers and options.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Dvali" <david_dvali@.hotmail.com> wrote in message
news:%23v4GnkBcFHA.3400@.tk2msftngp13.phx.gbl...
>I want change it globally for whole SQL Server?
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:OtEYGgBcFHA.3280@.TK2MSFTNGP09.phx.gbl...
>> For input or output?
>> I suggest you read below article. You find your answers in it:
>> http://www.karaszi.com/SQLServer/info_datetime.asp
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "David Dvali" <david_dvali@.hotmail.com> wrote in message
>> news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
>> Hello.
>> How can I change (global) date format from yyyy-MM-dd to my custom format?
>> Thank you.
>>
>

Change date format

HI,

I have noticed that SQL SERVER 2005 uses American date format but i want to change it to UK/European time format i.e. dd-mm-yyyy

can any on tell me how to do it in sql server settings. And is it possible that I can change it only the during the course of my STORED PROCEDURE.

I know it is quite and any one will answer that soon

hoping quick reply

regards,

Anas

I haven't used 2005 yet but assuming it has the same 'problem', make sure the language is set to 'british english' instead of 'english'|||

thanx for ur reply...

other query is that how will I able to change that setting for the course of my stored procedure? is it possible

waiting for your reply

regards,

Anas

|||That shouldn't be necessary once the database has been set to the correct language. But IIRC, you can set the language on a connection basis, but you should be able to locate this info in the SQLServer help file, I can't recall what the setting might be at the moment, probably SET LANGUAGE <language>

sql

change date format

I have a table with a date field. I need to convert the date so that it
returns in a text format of DDMMYY - no separators.
How do I do this?
I have done it like as follows: Is there a better way of doing it?
Here is what I have:
right(RTrim(convert(char(8),TrnDate,12)),2) +
substring(convert(char(8),TrnDate,12),3,2) +
left(convert(char(8),TrnDate,12),2) as DteVal
"Newbie" <noidea@.nospam.com> wrote in message
news:%23gfQUJ0zEHA.1192@.tk2msftngp13.phx.gbl...
> I have a table with a date field. I need to convert the date so that it
> returns in a text format of DDMMYY - no separators.
> How do I do this?
>
|||On Sat, 20 Nov 2004 21:57:21 -0000, Newbie wrote:

>I have done it like as follows: Is there a better way of doing it?
Hi Newbie,
Have you tried
REPLACE (CONVERT(char(8), TrnDate, 103), '/', '')
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Thanks for the reply. I gave it a go but for the date 17/04/2000 it
returned
170420 instead of
170400
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:55ivp01419rdl6enh9v0lolt1cak6a5r14@.4ax.com...
> On Sat, 20 Nov 2004 21:57:21 -0000, Newbie wrote:
>
> Hi Newbie,
> Have you tried
> REPLACE (CONVERT(char(8), TrnDate, 103), '/', '')
>
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)
|||Hugo's solution needs format 3, not 103:
This should work:
REPLACE (CONVERT(char(8), TrnDate, 3), '/', '')
Steve Kass
Drew University
Newbie wrote:

>Thanks for the reply. I gave it a go but for the date 17/04/2000 it
>returned
>170420 instead of
>170400
>
>"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
>news:55ivp01419rdl6enh9v0lolt1cak6a5r14@.4ax.com.. .
>
>
>
|||On Sun, 21 Nov 2004 09:37:38 -0000, Newbie wrote:

>Thanks for the reply. I gave it a go but for the date 17/04/2000 it
>returned
>170420 instead of
>170400
Hi Newbie,
My bad. Halfway through my post, I forgot that you didn't want all four
digits of the year and I autopiloted back to a format that uses the
complete year.
Steve is correct: 103 should have been 3.
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
|||Thanks - works a treat!
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:i342q0dcnf10r39nn5m35q4u38cblgtiib@.4ax.com...
> On Sun, 21 Nov 2004 09:37:38 -0000, Newbie wrote:
>
> Hi Newbie,
> My bad. Halfway through my post, I forgot that you didn't want all four
> digits of the year and I autopiloted back to a format that uses the
> complete year.
> Steve is correct: 103 should have been 3.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)

Change date format

Hello.
How can I change (global) date format from yyyy-MM-dd to my custom format?
Thank you.For input or output?
I suggest you read below article. You find your answers in it:
http://www.karaszi.com/SQLServer/info_datetime.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Dvali" <david_dvali@.hotmail.com> wrote in message
news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
> Hello.
> How can I change (global) date format from yyyy-MM-dd to my custom format?
> Thank you.
>|||I want change it globally for whole SQL Server?
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:OtEYGgBcFHA.3280@.TK2MSFTNGP09.phx.gbl...
> For input or output?
> I suggest you read below article. You find your answers in it:
> http://www.karaszi.com/SQLServer/info_datetime.asp
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "David Dvali" <david_dvali@.hotmail.com> wrote in message
> news:u1gf6dBcFHA.2128@.TK2MSFTNGP15.phx.gbl...
>|||That didn't answer my question. There no such thing as a global setting for
SQL Server datetime
format. You have to handle input in one way and output in another way. See m
y article, the first few
sections. It has all the answers and options.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"David Dvali" <david_dvali@.hotmail.com> wrote in message
news:%23v4GnkBcFHA.3400@.tk2msftngp13.phx.gbl...
>I want change it globally for whole SQL Server?
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote i
n message
> news:OtEYGgBcFHA.3280@.TK2MSFTNGP09.phx.gbl...
>

Monday, March 19, 2012

change data format in stored procedure

Hi All,

My scenario is that I want to change the default SQL server format in my stored procedure more preferably only during the course of stored procedure execution (not permanent changes does any one have idea that how will I able to achieve this simple task...

regards,

Anas

You can use the CONVERT function for this. As a common approach Date formatting should be done on the client and only on the server if you have no client application or the client application does not support it.

HTH, jens Suessmeyer.

http://www.sqlserver2005.de

Saturday, February 25, 2012

Chaging SSN Format

This is a repost due to know response:
If I use this formula:
SELECT LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum, 4)
as SSN, Clients.First_Name + ' ' + Clients.Last_Name
FROM Clients
It recodes the SSN as I need it. How do I get this result to the UPDATE
function inside the main db?
Possibly:
Update Clients
Set LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum, 4)
I tried that code but get a syntax error. Any ideas?> Possibly:
> Update Clients
> Set LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum,
> 4)
Try:
UPDATE dbo.Clients
SET ssnum = LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' +
RIGHT(ssnum, 4)
However, I generally suggest storing unformatted data and instead format
strings in the application/report during presentation
Hope this helps.
Dan Guzman
SQL Server MVP
"JOHN HARRIS" <harris1113@.fake.com> wrote in message
news:E9C89F84-1950-4670-A852-49033092BD83@.microsoft.com...
> This is a repost due to know response:
> If I use this formula:
> SELECT LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum,
> 4)
> as SSN, Clients.First_Name + ' ' + Clients.Last_Name
> FROM Clients
> It recodes the SSN as I need it. How do I get this result to the UPDATE
> function inside the main db?
> Possibly:
> Update Clients
> Set LEFT(ssnum, 3) + '-' + SUBSTRING(ssnum, 4, 2) + '-' + RIGHT(ssnum,
> 4)
> I tried that code but get a syntax error. Any ideas?

Friday, February 24, 2012

Cell Orientation

How do i format the Header cells to be oriented by 90 degrees like in Excel. I tried the WRITING MODE under INTERNATIONAL in properties, and choose "tb-rl". But it gives top to bottom. Is there any way to get it bottom to top?

Is there any example to write Expression in Writing Mode property to display in 30 degrees?

Thanks.

Girija, did you ever find a solution to this? I need to do the same thing, rotate headers by 90 degrees.

Thanks.

|||Unfortunately, this is not supported in the current version of Reporting Services. Arbitrary text rotation is something we would like to add in a future release.

Cell Orientation

How do i format the Header cells to be oriented by 90 degrees like in Excel. I tried the WRITING MODE under INTERNATIONAL in properties, and choose "tb-rl". But it gives top to bottom. Is there any way to get it bottom to top?

Is there any example to write Expression in Writing Mode property to display in 30 degrees?

Thanks.

Girija, did you ever find a solution to this? I need to do the same thing, rotate headers by 90 degrees.

Thanks.

|||Unfortunately, this is not supported in the current version of Reporting Services. Arbitrary text rotation is something we would like to add in a future release.

Cell Formatting

Hi,

On importing an XML file using VBA I/O function, I need to apply rules/format to specific Excel 2003 .Cells.

XML
<Column FieldName="ProductReference" FieldNumber="1">
<DataType>character</DataType>
<Format>x(20)</Format>
<Restrictions/>
<Mandatory>true</Mandatory>
<PermittedValues/>
</Column>

If the above XML-lines (strings) are read, I need to apply the following rules/formats to the identified .Cells(x,1):

1.
.Columns("A").NumberFormat = "General" or "Text" ??
2.
That when inputting a value, the user is restricted to 20 Characters
3.
That this is a Mandatory entry field

These values obviously change as per XML Output. Can anyone help, please?Is this related to Crystal Reports?

Sunday, February 19, 2012

CDONTS on sql2000 ?

I need to send email in html format, but xp_sendmail
doesnot support it.
Does anyone know hot to use cdonts on sql2000 ?
Thx.On Tue, 4 Nov 2003 16:59:28 -0800, "Kresna Rudy Kurniawan"
<kresna_rk@.yahoo.com> wrote:
>I need to send email in html format, but xp_sendmail
>doesnot support it.
>Does anyone know hot to use cdonts on sql2000 ?
Instead of CDONTS, use CDOSYS on Windows 2000.
http://msdn.microsoft.com/library/en-us/dnanchor/html/collabdataobjects.asp
--
Ross McKay, WebAware Pty Ltd
"Words can only hurt if you try to read them. Don't play their game" - Zoolander|||> Does anyone know hot to use cdonts on sql2000 ?
CDONTS is deprecated.
Use CDO.Message or, better yet, xp_smtp_sendmail.
http://www.aspfaq.com/2403|||You can use XPSMTP instead, see http://SQLDev.Net/xp/xpsmtp.htm
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright © SQLDev.Net 1991-2003 All rights reserved.
"Kresna Rudy Kurniawan" <kresna_rk@.yahoo.com> wrote in message
news:05c201c3a338$109174d0$a401280a@.phx.gbl...
> I need to send email in html format, but xp_sendmail
> doesnot support it.
> Does anyone know hot to use cdonts on sql2000 ?
> Thx.