Friday, March 30, 2012
how to format this layout?
I have to incorporate a subreport into my main report. if my main report shows state, county, city and my subreport shows county and school name. how can I show just the schools that are in that county.
my question is how can I apply a condition to show schools in the subreport where county name (subreport ) = county name (main report) ?
attached is an image of the layout.
I know it's probably easy but I'm new to Crystal.
thank youYou can link the subreport with the main report. Right-click on sub-report and select 'Change Sub-report links' option. In the Link window,select the 'County Name' field from the Main report. Select the checkbox 'Select Data in Subreport based on field'.
Hope it helps !!!
Rashmi|||yup that was it .thank you very much
How to Format the Number for Total
I am using Crystal Report 9.2.
In my project, i am in need of finding the Subtotal, totals.
While doing so, its assigning the value as 2,234,456.00
i am in need of that display to be 22,34,456.00.
i tried for Formula Field & also Selection Formula's Group in Crystal Report.
In the Format Field, i am not able to customize for thousand.
Can any one help me to solve my problem for finding the total.Interesting question. I don't think you can do this easily. You might have to create a new formula field and use string manipulation.|||Hai Babu - Moderator,
Are u there? Why no reply from u?
Regards
Geetha|||hai Moderator,
What happened to u?
why u r not responding.
in crystal report as well as in access, we have this type of display for the totals.
rectify this.
Regards
geetha|||Convert the money to text and seperate the digits according to the format you want and combine them by ","
how to format the date data type input in DD-MM-YY
INSERT INTO ADMIN ( ID , NAME , DATE ) VALUES ( 'A001' , 'karen' ,'2/6/2004 11:07:46 AM')
the date will automatically converted to 06-02-04 and store in DB .
Does it need to use SQL Rule or user-defined data type.Originally posted by verybrightstar
hi all , does SQL server able to input the date that is originally from 2/6/2004 11:07:46 AM to DD-MM-YY 06-02-04 and store in the DB. For example , this is the SQL insert query
INSERT INTO ADMIN ( ID , NAME , DATE ) VALUES ( 'A001' , 'karen' ,'2/6/2004 11:07:46 AM')
the date will automatically converted to 06-02-04 and store in DB .
Does it need to use SQL Rule or user-defined data type.
INSERT INTO ADMIN ( ID , NAME , DATE ) VALUES ( 'A001' , 'karen' ,convert(varchar,'2/6/2004 11:07:46 AM',105))
how to format text fields
I´m just wondering, how to (RS2000):
How can I reach that a textfield content is being cut by a page break and
continued on page 2?
(In print preview mode: now if the textfield content doesn´t fit on the same
page, it´s printed on page 2, leaving a lot of blank space on page 1.
Let´s say the content is 30 lines long:
I simply want to get the first 20 lines on page 1 (till page end) and the
rest 10 lines on page 2.
I experimented, now CanGrow=True and CanShrink=True, but I didn´t find any
more properties controlling this behavior.)
Is there any way to format _parts_ of a textfield content in different ways
(f.e. some words bold)?
(Now each time a text shall be bold (f.e. headings and text) , I have to
create an own textbox and then an own textboxes for the text, followed by a
new sections and so on. That´s exhausting. Any better way to reach that?)
Thanks for tips!
Toni> How can I reach that a textfield content is being cut by a page break and
> continued on page 2?
> (In print preview mode: now if the textfield content doesn´t fit on the
> same page, it´s printed on page 2, leaving a lot of blank space on page 1.
Is the text field in a table or dumped to a textbox control?
-Tim
> Is there any way to format _parts_ of a textfield content in different
> ways (f.e. some words bold)?
There's no way I'm aware of that would allow this behavior. Font weight no
text boxes are pretty much an all or none property.
"Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
news:OUwE$OreGHA.1204@.TK2MSFTNGP02.phx.gbl...
> Hi all,
> I´m just wondering, how to (RS2000):
> How can I reach that a textfield content is being cut by a page break and
> continued on page 2?
> (In print preview mode: now if the textfield content doesn´t fit on the
> same page, it´s printed on page 2, leaving a lot of blank space on page 1.
> Let´s say the content is 30 lines long:
> I simply want to get the first 20 lines on page 1 (till page end) and the
> rest 10 lines on page 2.
> I experimented, now CanGrow=True and CanShrink=True, but I didn´t find any
> more properties controlling this behavior.)
> Is there any way to format _parts_ of a textfield content in different
> ways (f.e. some words bold)?
> (Now each time a text shall be bold (f.e. headings and text) , I have to
> create an own textbox and then an own textboxes for the text, followed by
> a new sections and so on. That´s exhausting. Any better way to reach
> that?)
> Thanks for tips!
> Toni
>|||Hi Tim,
The field content is bound to a textbox control.
(The whole report contains mostly text in a lot of textboxes.)
Thanks,
Toni
"Tim Dot NoSpam" <Tim.NoSpam@.hughes.net> schrieb im Newsbeitrag
news:u8mnm6teGHA.4948@.TK2MSFTNGP04.phx.gbl...
>> How can I reach that a textfield content is being cut by a page break and
>> continued on page 2?
>> (In print preview mode: now if the textfield content doesn´t fit on the
>> same page, it´s printed on page 2, leaving a lot of blank space on page
>> 1.
> Is the text field in a table or dumped to a textbox control?
> -Tim
>> Is there any way to format _parts_ of a textfield content in different
>> ways (f.e. some words bold)?
> There's no way I'm aware of that would allow this behavior. Font weight
> no text boxes are pretty much an all or none property.
> "Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
> news:OUwE$OreGHA.1204@.TK2MSFTNGP02.phx.gbl...
>> Hi all,
>> I´m just wondering, how to (RS2000):
>> How can I reach that a textfield content is being cut by a page break and
>> continued on page 2?
>> (In print preview mode: now if the textfield content doesn´t fit on the
>> same page, it´s printed on page 2, leaving a lot of blank space on page
>> 1.
>> Let´s say the content is 30 lines long:
>> I simply want to get the first 20 lines on page 1 (till page end) and the
>> rest 10 lines on page 2.
>> I experimented, now CanGrow=True and CanShrink=True, but I didn´t find
>> any more properties controlling this behavior.)
>> Is there any way to format _parts_ of a textfield content in different
>> ways (f.e. some words bold)?
>> (Now each time a text shall be bold (f.e. headings and text) , I have to
>> create an own textbox and then an own textboxes for the text, followed by
>> a new sections and so on. That´s exhausting. Any better way to reach
>> that?)
>> Thanks for tips!
>> Toni
>|||Toni:
Are your text boxes within a Table? If so, use a List object instead of
Tables. I've found this to work much better. There seems to be a bug in the
Table object when displaying large amounts of text.
HTH.
Richard.
"Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
news:%23h763nxeGHA.4828@.TK2MSFTNGP05.phx.gbl...
> Hi Tim,
> The field content is bound to a textbox control.
> (The whole report contains mostly text in a lot of textboxes.)
> Thanks,
> Toni
> "Tim Dot NoSpam" <Tim.NoSpam@.hughes.net> schrieb im Newsbeitrag
> news:u8mnm6teGHA.4948@.TK2MSFTNGP04.phx.gbl...
>> How can I reach that a textfield content is being cut by a page break
>> and continued on page 2?
>> (In print preview mode: now if the textfield content doesn´t fit on the
>> same page, it´s printed on page 2, leaving a lot of blank space on page
>> 1.
>> Is the text field in a table or dumped to a textbox control?
>> -Tim
>> Is there any way to format _parts_ of a textfield content in different
>> ways (f.e. some words bold)?
>> There's no way I'm aware of that would allow this behavior. Font weight
>> no text boxes are pretty much an all or none property.
>> "Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
>> news:OUwE$OreGHA.1204@.TK2MSFTNGP02.phx.gbl...
>> Hi all,
>> I´m just wondering, how to (RS2000):
>> How can I reach that a textfield content is being cut by a page break
>> and continued on page 2?
>> (In print preview mode: now if the textfield content doesn´t fit on the
>> same page, it´s printed on page 2, leaving a lot of blank space on page
>> 1.
>> Let´s say the content is 30 lines long:
>> I simply want to get the first 20 lines on page 1 (till page end) and
>> the rest 10 lines on page 2.
>> I experimented, now CanGrow=True and CanShrink=True, but I didn´t find
>> any more properties controlling this behavior.)
>> Is there any way to format _parts_ of a textfield content in different
>> ways (f.e. some words bold)?
>> (Now each time a text shall be bold (f.e. headings and text) , I have to
>> create an own textbox and then an own textboxes for the text, followed
>> by a new sections and so on. That´s exhausting. Any better way to reach
>> that?)
>> Thanks for tips!
>> Toni
>>
>|||I am haveing the exact same issue and my data is in a List object. Is
there anyone out there that has figured out a way to get the text to
flow spothly across pages?
Thanks
Edney Holder
Richard Wodabek wrote:
> Toni:
> Are your text boxes within a Table? If so, use a List object instead of
> Tables. I've found this to work much better. There seems to be a bug in t=he
> Table object when displaying large amounts of text.
> HTH.
> Richard.
> "Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
> news:%23h763nxeGHA.4828@.TK2MSFTNGP05.phx.gbl...
> > Hi Tim,
> >
> > The field content is bound to a textbox control.
> > (The whole report contains mostly text in a lot of textboxes.)
> >
> > Thanks,
> > Toni
> >
> > "Tim Dot NoSpam" <Tim.NoSpam@.hughes.net> schrieb im Newsbeitrag
> > news:u8mnm6teGHA.4948@.TK2MSFTNGP04.phx.gbl...
> >> How can I reach that a textfield content is being cut by a page break
> >> and continued on page 2?
> >> (In print preview mode: now if the textfield content doesn=B4t fit on= the
> >> same page, it=B4s printed on page 2, leaving a lot of blank space on =page
> >> 1.
> >>
> >> Is the text field in a table or dumped to a textbox control?
> >>
> >> -Tim
> >>
> >> Is there any way to format _parts_ of a textfield content in different
> >> ways (f.e. some words bold)?
> >>
> >> There's no way I'm aware of that would allow this behavior. Font weig=ht
> >> no text boxes are pretty much an all or none property.
> >>
> >> "Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
> >> news:OUwE$OreGHA.1204@.TK2MSFTNGP02.phx.gbl...
> >> Hi all,
> >>
> >> I=B4m just wondering, how to (RS2000):
> >>
> >> How can I reach that a textfield content is being cut by a page break
> >> and continued on page 2?
> >> (In print preview mode: now if the textfield content doesn=B4t fit on= the
> >> same page, it=B4s printed on page 2, leaving a lot of blank space on =page
> >> 1.
> >> Let=B4s say the content is 30 lines long:
> >> I simply want to get the first 20 lines on page 1 (till page end) and
> >> the rest 10 lines on page 2.
> >> I experimented, now CanGrow=3DTrue and CanShrink=3DTrue, but I didn==B4t find
> >> any more properties controlling this behavior.)
> >>
> >> Is there any way to format _parts_ of a textfield content in different
> >> ways (f.e. some words bold)?
> >> (Now each time a text shall be bold (f.e. headings and text) , I have= to
> >> create an own textbox and then an own textboxes for the text, followed
> >> by a new sections and so on. That=B4s exhausting. Any better way to r=each
> >> that?)
> >>
> >> Thanks for tips!
> >> Toni
> >>
> >>
> >>
> >
> >|||I am haveing the exact same issue and my data is in a List object. Is
there anyone out there that has figured out a way to get the text to
flow spothly across pages?
Thanks
Edney Holder
Richard Wodabek wrote:
> Toni:
> Are your text boxes within a Table? If so, use a List object instead of
> Tables. I've found this to work much better. There seems to be a bug in t=he
> Table object when displaying large amounts of text.
> HTH.
> Richard.
> "Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
> news:%23h763nxeGHA.4828@.TK2MSFTNGP05.phx.gbl...
> > Hi Tim,
> >
> > The field content is bound to a textbox control.
> > (The whole report contains mostly text in a lot of textboxes.)
> >
> > Thanks,
> > Toni
> >
> > "Tim Dot NoSpam" <Tim.NoSpam@.hughes.net> schrieb im Newsbeitrag
> > news:u8mnm6teGHA.4948@.TK2MSFTNGP04.phx.gbl...
> >> How can I reach that a textfield content is being cut by a page break
> >> and continued on page 2?
> >> (In print preview mode: now if the textfield content doesn=B4t fit on= the
> >> same page, it=B4s printed on page 2, leaving a lot of blank space on =page
> >> 1.
> >>
> >> Is the text field in a table or dumped to a textbox control?
> >>
> >> -Tim
> >>
> >> Is there any way to format _parts_ of a textfield content in different
> >> ways (f.e. some words bold)?
> >>
> >> There's no way I'm aware of that would allow this behavior. Font weig=ht
> >> no text boxes are pretty much an all or none property.
> >>
> >> "Toni Pohl" <atwork43@.hotmail.com__nospam> wrote in message
> >> news:OUwE$OreGHA.1204@.TK2MSFTNGP02.phx.gbl...
> >> Hi all,
> >>
> >> I=B4m just wondering, how to (RS2000):
> >>
> >> How can I reach that a textfield content is being cut by a page break
> >> and continued on page 2?
> >> (In print preview mode: now if the textfield content doesn=B4t fit on= the
> >> same page, it=B4s printed on page 2, leaving a lot of blank space on =page
> >> 1.
> >> Let=B4s say the content is 30 lines long:
> >> I simply want to get the first 20 lines on page 1 (till page end) and
> >> the rest 10 lines on page 2.
> >> I experimented, now CanGrow=3DTrue and CanShrink=3DTrue, but I didn==B4t find
> >> any more properties controlling this behavior.)
> >>
> >> Is there any way to format _parts_ of a textfield content in different
> >> ways (f.e. some words bold)?
> >> (Now each time a text shall be bold (f.e. headings and text) , I have= to
> >> create an own textbox and then an own textboxes for the text, followed
> >> by a new sections and so on. That=B4s exhausting. Any better way to r=each
> >> that?)
> >>
> >> Thanks for tips!
> >> Toni
> >>
> >>
> >>
> >
> >sql
How to Format Text Area in Report
I need create report that should look like a letter,
i.e. I have long, formatted text, where I should place few fields from
the record.
For instance:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dear Sir,
1. Hear goes
2. some formatted text
3. and {Fields!one_field.Value} inserted at line number 3
4. and {Fields!another_field.Value} inserted here
And text continues here
and here, and {Fields!next_filed.Value}
etc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I did not found possibility to have one text box with formatted content
and fields/ calculations inserted into it in Report Design.
I tried also divide my text area to few text boxes where static text was
separated from data fields, but I've got into the issues with spacing
between the fields. It looks good in design view, but in preview it adds
extra vertical spaces within the fields. Also it is quite hard to format
a set of text boxes to look like one formatted letter.
Is it possible insert fields into formatted text box? If no, how in
general I should build such report?
Thanks for any help,
Alexander.On Dec 25, 2:38 am, "Alexander N. Treyner" <a...@.treyner.israel.net>
wrote:
> Hi,
> I need create report that should look like a letter,
> i.e. I have long, formatted text, where I should place few fields from
> the record.
> For instance:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dear Sir,
> 1. Hear goes
> 2. some formatted text
> 3. and {Fields!one_field.Value} inserted at line number 3
> 4. and {Fields!another_field.Value} inserted here
> And text continues here
> and here, and {Fields!next_filed.Value}
> etc.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> I did not found possibility to have one text box with formatted content
> and fields/ calculations inserted into it in Report Design.
> I tried also divide my text area to few text boxes where static text was
> separated from data fields, but I've got into the issues with spacing
> between the fields. It looks good in design view, but in preview it adds
> extra vertical spaces within the fields. Also it is quite hard to format
> a set of text boxes to look like one formatted letter.
> Is it possible insert fields into formatted text box? If no, how in
> general I should build such report?
> Thanks for any help,
> Alexander.
You should consider using a table control in place of the textboxes.
This should allow for a little better layout/design flexibility. Also,
concatenating text and expressions/etc together as an expression is
fairly straight forward, i.e.,:
="and " + Fields!one_field.Value + "inserted at line number 3"
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||EMartinez wrote:
> You should consider using a table control in place of the textboxes.
> This should allow for a little better layout/design flexibility. Also,
> concatenating text and expressions/etc together as an expression is
> fairly straight forward, i.e.,:
> ="and " + Fields!one_field.Value + "inserted at line number 3"
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
I tried to use expression, but it does not allow to format text. How can
I insert CRLF in the expression? I tried chr(10)+chr(13). It looks good
in preview, when I run report from my web site, seems it just ignore it
and print report without CRLF.
I will try to use tables.
Thanks,
Alex.|||EMartinez wrote:
> You should consider using a table control in place of the textboxes.
> This should allow for a little better layout/design flexibility. Also,
> concatenating text and expressions/etc together as an expression is
> fairly straight forward, i.e.,:
> ="and " + Fields!one_field.Value + "inserted at line number 3"
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
I tried to use expression, but it does not allow to format text. How can
I insert CRLF in the expression? I tried chr(10)+chr(13). It looks good
in preview, when I run report from my web site, seems it just ignore it
and print report without CRLF.
I will try to use tables.
Thanks,
Alex.|||RS is pretty crummy at this time for this. RS 2008 will have much better
support for rich text. I have not experimented with it in pre-release
software so other than knowing the support will be better (i.e. there will
be support for rich text) I can't give you particulars.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"Alexander N. Treyner" <alex@.treyner.israel.net> wrote in message
news:ufqbGGtRIHA.536@.TK2MSFTNGP06.phx.gbl...
> Hi,
> I need create report that should look like a letter,
> i.e. I have long, formatted text, where I should place few fields from the
> record.
> For instance:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dear Sir,
> 1. Hear goes
> 2. some formatted text
> 3. and {Fields!one_field.Value} inserted at line number 3
> 4. and {Fields!another_field.Value} inserted here
> And text continues here
> and here, and {Fields!next_filed.Value}
> etc.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> I did not found possibility to have one text box with formatted content
> and fields/ calculations inserted into it in Report Design.
> I tried also divide my text area to few text boxes where static text was
> separated from data fields, but I've got into the issues with spacing
> between the fields. It looks good in design view, but in preview it adds
> extra vertical spaces within the fields. Also it is quite hard to format a
> set of text boxes to look like one formatted letter.
>
> Is it possible insert fields into formatted text box? If no, how in
> general I should build such report?
> Thanks for any help,
> Alexander.
How to format prediction Expression
hi,
when i make use of predicton functions, the output is formatted in its own.But I want to format that.How to do that?
Thanks,
Karthik.
hi Shuvro,
Thanks For your reply.Is it possible to format the resultset returned from a prediction function.
For Example,In this query, select PredictTimeSeries(Performance,5) FROM [Stud_Model] I am getting the resultset as Expression.$Time Expression.Performance
200611 90
200612 95 like that.
I want to give my own columnnames as Year and performance.how to do that?
Thanks,
Karthik.
|||You can try
select Flattened
(
select $time as TimeStamp, [Performance] as Perf from PredictTimeSeries([Performance], 5)
) as A from [Stud_Model]
This allows you to customize the name of each column, as well as the name of the whole sub-select, and the results should look like
A.TimeStamp, A.Perf
|||Thanks a lot bogdan,thats very helpful to me.
Karthik.
How to format numerics with the sign on the right?
(if negative) on the right. But I also want the numbers to line up properly.
I can't seem to find a way to format this. In Excel, you'd use a format like
#,##0.00_);#,##0.00-. But that does not quite do it in Reporting Services. I
see you can use custom formats and the syntax is similar to Excel but not
quite the same. I tried:
#,##0.00 ;#,##0.00-
but RS seems to ignore the whitespace. I also tried:
#,##0.00' ';#,##0.00-
also to no avail.
Any suggestions?What about using double quotes: " " ?
"virtualfergy" wrote:
> I've got an amount field in a report where I want the values to have the sign
> (if negative) on the right. But I also want the numbers to line up properly.
> I can't seem to find a way to format this. In Excel, you'd use a format like
> #,##0.00_);#,##0.00-. But that does not quite do it in Reporting Services. I
> see you can use custom formats and the syntax is similar to Excel but not
> quite the same. I tried:
> #,##0.00 ;#,##0.00-
> but RS seems to ignore the whitespace. I also tried:
> #,##0.00' ';#,##0.00-
> also to no avail.
> Any suggestions?|||Tried it. No luck I'm afraid. Works the same as single quotes. Any other
advice out there?
"Albert" wrote:
> What about using double quotes: " " ?
> "virtualfergy" wrote:
> > I've got an amount field in a report where I want the values to have the sign
> > (if negative) on the right. But I also want the numbers to line up properly.
> > I can't seem to find a way to format this. In Excel, you'd use a format like
> > #,##0.00_);#,##0.00-. But that does not quite do it in Reporting Services. I
> > see you can use custom formats and the syntax is similar to Excel but not
> > quite the same. I tried:
> >
> > #,##0.00 ;#,##0.00-
> >
> > but RS seems to ignore the whitespace. I also tried:
> >
> > #,##0.00' ';#,##0.00-
> >
> > also to no avail.
> >
> > Any suggestions?
How to format numbers in SQL Query
Ex: In my table the TotalAmout is a numeric field. if i use (Select TotalAmount from Table1) then query will return numbers like
Totalamount
-------
12232.88
23233.22
23559.99
32434.99
but i want he result like comma separated format
like
12,232.88
23,233.22
23,559.99
32,434.99Create the below function and use it as said below.
/*This function is only for thousand separator for numbers with length 5 or 4*/
CREATE FUNCTION DBO.SEPARATETHOUSANDNUM
(
@.STRVALUE VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @.STRRETURNVALUE VARCHAR(8000)
SELECT @.STRRETURNVALUE = CASE LEN(@.STRVALUE)
WHEN 5 THEN LEFT(@.STRVALUE,2)+ ','+ RIGHT(@.STRVALUE,3)
WHEN 4 THEN LEFT(@.STRVALUE,1)+ ','+ RIGHT(@.STRVALUE,3)
ELSE @.STRVALUE END
RETURN @.STRRETURNVALUE
END
SELECT DBO.SEPAREATENUMBERS(23565) AS CHANGEDCOLUMN
gives 23,565
SELECT DBO.SEPAREATENUMBERS(2365) AS CHANGEDCOLUMN
gives 2,365
So use
Select DBO.SEPARATETHOUSANDNUM(TotalAmount) from Table1
Quote:
Originally Posted by sukeshchand
any body have an idea abou how to wirte a function for formating a numeric field.
Ex: In my table the TotalAmout is a numeric field. if i use (Select TotalAmount from Table1) then query will return numbers like
Totalamount
-------
12232.88
23233.22
23559.99
32434.99
but i want he result like comma separated format
like
12,232.88
23,233.22
23,559.99
32,434.99
like this
select convert(varchar(50),convert(momey,TotalAmount),1) from BillMaser|||
Quote:
Originally Posted by sukeshchand
I got an another easy solution for that and no need for any functions
like this
select convert(varchar(50),convert(momey,TotalAmount),1) from BillMaser
Excellent! Thanks for posting the solution!|||
Quote:
Originally Posted by sukeshchand
I got an another easy solution for that and no need for any functions
like this
select convert(varchar(50),convert(money,TotalAmount),1) from BillMaser
i'm using this query, it works, but my problem now is that this query automatically rounds to 2 decimal places.
ex.
1200.114 = 1,200.11
is there a query that formats the result but does not round the decimals?|||
Quote:
Originally Posted by mjv
i'm using this query, it works, but my problem now is that this query automatically rounds to 2 decimal places.
ex.
1200.114 = 1,200.11
is there a query that formats the result but does not round the decimals?
try adding precision on your convert function.
actually, although this is feasible in the database/back-end, i believe this can be better be handled in the front-end.
How to format numbers in a query
i.e.,
SELECT tblNumericCovert.number1, tblNumericCovert.number2, [number1]/[number2] AS testDiv
FROM tblNumericCovert
where testDiv needs to spit out results like this ###.##
I am totally lost, if anyone can help, I would appreciate it.select to_char(number1/number2, '99.99') As testDiv from table;|||Originally posted by r123456
select to_char(number1/number2, '99.99') As testDiv from table;
When I do this, I get the error message that "to_char is not a vaild function name'|||What db are you using? to_char works for Oracle, but not SQL server.
Try:
select convert(money, (number1/number2)) As testDiv from tablesql
How to format measure descriptions
report based on a cube, you are presented with a detail
column for your measure and a column to the left of that
for the description of the measure. My report has several
rows of measures that present (for example) both units
and dollars. I want to be able to leave a blank line
between the units section and the dollars section. I also
want to be able to place a heading for each section. The
preference is that the heading be off to the left rather
than above -- but i am not able to add a second
description column. So I placed text in the description
column to simulate the desired formatting.
For example:
Units Prod1
Prod2
Prod3
Total
Sales Prod1
Prod2
Prod3
Total
This approach looks fine in the designer. But when i
publish the report and view it in IE, all extra spaces
are gone (both horizontally and vertically) so the
descriptions look as below:
Units Prod1
Prod2
Prod3
Total
Sales Prod1
Prod2
Prod3
Total
Any suggestions on how to get a better presentation of
the descriptions?Try Using Padding ?
"Daniel Edwards" <DanielEdwards@.discussions.microsoft.com> wrote in message
news:A5663DB5-D5DD-4132-AEA5-A9D19EDFE713@.microsoft.com...
> When using a matrix in Reporting Services to design a
> report based on a cube, you are presented with a detail
> column for your measure and a column to the left of that
> for the description of the measure. My report has several
> rows of measures that present (for example) both units
> and dollars. I want to be able to leave a blank line
> between the units section and the dollars section. I also
> want to be able to place a heading for each section. The
> preference is that the heading be off to the left rather
> than above -- but i am not able to add a second
> description column. So I placed text in the description
> column to simulate the desired formatting.
> For example:
> Units Prod1
> Prod2
> Prod3
> Total
> Sales Prod1
> Prod2
> Prod3
> Total
> This approach looks fine in the designer. But when i
> publish the report and view it in IE, all extra spaces
> are gone (both horizontally and vertically) so the
> descriptions look as below:
> Units Prod1
> Prod2
> Prod3
> Total
> Sales Prod1
> Prod2
> Prod3
> Total
> Any suggestions on how to get a better presentation of
> the descriptions?
>
How to format leave detail into tabular/pivot format?
Hello Expert!
I need help to I translate this data...
Table "LeaveDetail"
StaffNo | StartDate | EndDate | LeaveType |
1 | 23/04/2006 | 26/04/2006 | AL |
2 | 24/04/2006 | 25/04/2006 | MC |
3 | 26/04/2006 | 27/04/2006 | EL |
1 | 30/04/2006 | 02/05/2006 | EL |
Into this format...
|Apr|Apr|Apr|Apr|Apr|Apr|Apr|Apr|May|May|May|May|
StaffNo |23 |24 |25 |26 |27 |28 |29 |30 |01 |02 |03 |04..
1 |AL |AL |AL |AL | | ... |EL |EL |EL |
2 | |MC |MC | | |
3 | | | |EL |EL |
Parameter:
Date From e.g. 23/04/2006 to 23/05/2006
Using only query statement...
Is this possible?
TIA
Regards.
WOuld be very heavy query, do you have a calendar table to join to ?HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||You could do it in a SELECT statement or using PIVOT operator in SQL Server 2005. But there is no dynamic aspect for the query i.e., the names of the columns (Apr 23, Apr 24) should be hard-coded in the SELECT statement unless you generate the column names at run-time and use dynamic SQL to execute the query. So your options are fairly limited. On the other hand, this type of pivot operation is a breeze to do on the client side. Any reporting tool wll handle this without a problem. So if it is a one-time affair then you can write a SELECT statement to get the expected results. Otherwise you will have to use a solution that is easy to maintain and extend based on what I described above.|||
Hmm..
No I don' have, appreciate if you can guide me on that
|||I forgot to mention I’m using MS SQL Server 7
I found similar solution in MS Access. All done with 1 Table for days + query to convert to pivot/crosstab format, no coding in client side and no formatting in reporting tool needed
e.g.
TblDay e.g.: 1,2,3,4....31
The query:
PARAMETERS [Enter Month] Text ( 255 ), [Enter Year] Text ( 255 );
TRANSFORM First(LeaveDetail.LeaveType) AS FirstOfLeaveType
SELECT EmpNo
FROM tblDays, LeaveDetail
WHERE DateSerial([Enter Year],[Enter Month],[Day])) Between [LeaveDetail].[dStartDate] And [LeaveDetail].[dEndDate]
GROUP BY EmpNo
ORDER BY EmpNo
PIVOT tblDays.Day In (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31);
The result will look like this:
StaffNo |1 |2 |3 |4 |5 |6 |7 |8 |9 |10 |11 |12..
1 |AL |AL |AL |AL | | ... |EL |EL |EL |
I know there are no such functions for tabular format in SQL Server 7, so I’m here to find similar solution that producing result as I have mention earlier which not depend on client or reporting tool
Is this possible?
|||this thing looks like a cross tab queries.
maybe some examples from here will help.
http://www.sqlmag.com/Article/ArticleID/15608/15608.html
pls see the zip files
here some more
http://www.sqlteam.com/item.asp?ItemID=2955
you have do it thru dynamic query
|||Thanks, I'll try
Regards
How to format KPI values in KPI definition?
Hi, experts,
How can we format KPI values in the KPI value expression? (e.g. format KPI_Name with format of 2 decimal places?).
Hope it is clear for your help. I am looking forward to hearing from you shortly.
Thanks a lot in advance.
With kindest regards,
Yours sincerely,
Hi Helen! I do not think you can format KPI. You can use a calculated member as the value expression /source for the KPI and format it instead.
HTH
Thomas Ivarsson
|||Hi, Thomas,
Thanks for your help. I also found a strange problem that when I build the report with KPI values displayed in SSRS 2005, the values are with many decimal places instead of the formats I have already set up in the Analysis services cubes? (e.g, I formated the KPI values by using a calculated member in calculations with 2 decimal places, but the KPI values displayed on SSRS2005 are with many decimal places? e.g. 2.455879..?)
I have no idea what is going on. I am looking forward to hearing from you.
With kindest regards,
Yours sincerely,
|||Hi Helen! I have seen the same behaviour in SSRS2005. You are aware of that Reporting Services do not show SSAS2005 KPI status and trends graphically? You will only see numbers.
SSRS2005 do not seem to use the formats from relational sources nore SSAS2005. I think you will have to apply formats once again in SSRS2005 like "### ####,##"
HTH
Thomas Ivarsson
|||Hi, Thomas,
Thanks very much for your patient advices and help.
Yes, I am aware of this problem that SSRS2005 is not able to show KPI status and trend graphically.
With kindest regards,
Yours sincerely,
how to format in to dd/mm/yyyy ?
hi all,
i have table field name call
Start_date varchar(16)
when i select data from that filed values it gives me
Eg:
select Start_date from Customer
20011224 00:00:0
20011004 00:00:0
but i want to convert this data in to dd/mm/yyyy format ?
like ! 24/12/2001
04/10/2001
how do i do this task ?
regards
sujithf
create table #format (
start_Date_time varchar(16)
)
insert into #format values('20011224 00:00:0')
select convert(varchar(16), cast(start_date_time as datetime), 103) from #format
--103 is a British/French date format "dd/mm/yyyy"
|||thanks very much.....
regards
sujithf
How to format in SSMS?
How can I format a query in SSMS so it does not look like this:
sELecT * fRoM CusTomERs
Currently SSMS doesn't have any tools to format queries except of query designer and Ctrl+Shift+U or Ctrl+Shift+L.|||I use promptsql.com for intellisense, which allow me to pick table and column names from a drop down. It integrates with SSMS and QA. -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ Blog: http://solidqualitylearning.com/blogs/tibor/> Currently SSMS doesn't have any tools to format queries except of query
> designer and Ctrl+Shift+U or Ctrl+Shift+L.
>|||
Somebdy wake me from this bad dream!
Yes I have tried promptsql. It is slow and does not format keywords, but is the only intellisense addon that works with SSMS. A much better product is SqlAssist but only works in Visual Studio. VS on the other hand is horrible for working with dbs, so I started cutting and pasting queries into SSMS.
Shame on Microsoft for all this marketting hoopla and they basically put out archaic software that is stuck in the 70s.
|||FWIW the latest release of PromptSQL will auto-uppercase keywords, and has new caching features which should make it faster.sql
How to format in SSMS?
How can I format a query in SSMS so it does not look like this:
sELecT * fRoM CusTomERs
Currently SSMS doesn't have any tools to format queries except of query designer and Ctrl+Shift+U or Ctrl+Shift+L.|||I use promptsql.com for intellisense, which allow me to pick table and column names from a drop down. It integrates with SSMS and QA. -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ Blog: http://solidqualitylearning.com/blogs/tibor/> Currently SSMS doesn't have any tools to format queries except of query
> designer and Ctrl+Shift+U or Ctrl+Shift+L.
>|||
Somebdy wake me from this bad dream!
Yes I have tried promptsql. It is slow and does not format keywords, but is the only intellisense addon that works with SSMS. A much better product is SqlAssist but only works in Visual Studio. VS on the other hand is horrible for working with dbs, so I started cutting and pasting queries into SSMS.
Shame on Microsoft for all this marketting hoopla and they basically put out archaic software that is stuck in the 70s.
|||FWIW the latest release of PromptSQL will auto-uppercase keywords, and has new caching features which should make it faster.
How to format in SQL
Hi All,
I have a serial number field in table. Field type is integer. It is just stored as 1,2,3,12,13, etc.
It is showing as 00001,00002,00003,00012,00013 in interface. C# string format is very easy to changed the format.
But when i export to excel there is a problem. Let me know how to format string in SQL and export to excel.
Thanks
Aung
Hi Aung,
You may want to try this
select right('00000'+cast(serialno as varchar(5)),5) from table
|||
select right('0000'+cast(serialno as varchar(5)),5) from table
should work.
Or you can use:
SELECTRIGHT('0000'+CONVERT(VARCHAR(5),serialno),5) FROM yourTable
|||Thanks BRO...
This is what I want.
How to format Field ?
For example :
I key in VB : 123
In SqlServer database should appear : ***
Yoir help will be appreaciated.
daniel.Daniel:
I don't think that this is a datawarehouse question, but nevertheless
In SQLServer it is not possible to individually mask (as in MS Access) or
encrypt a single column as such. You would have to write your own encryption
routine or get one (many are available).
I usually encrypt my passwords and also set proper user rights restrictions
in order to protect the passwords.
Balaji Vasudevan
"Daniel" <anonymous@.discussions.microsoft.com> wrote in message
news:E11D06A0-335A-481D-8A7B-7D32FE0F6E9D@.microsoft.com...
quote:
> HOw to set the field (Password) in sqlServer database to '*' .
> For example :
> I key in VB : 123
> In SqlServer database should appear : ***
> Yoir help will be appreaciated.
> daniel.
How to format DateTime field in Crystal
Help!!
johnright click, format field, date and time tab, customize, date and time tab, choose 'date' in Order dropdown, then use date tab to choose format.
How to format cell according to different data type
I have a table cell which could accomodate date,currency,numeric at run
time,how do I set up individual format for each type? I don't know vb
so I'd appreciated for any help.
ThanksGetting the difference between curency and numeric is a challenge, for the
rest you can do a nested iif expression for the format property eg:
=iif(isdate( Fields!Yourfield.Value),"dd MMM
yyyy",isnumeric(Fields!Yourfield.Value),"N","C")
"ottawa111" wrote:
> Hi,
> I have a table cell which could accomodate date,currency,numeric at run
> time,how do I set up individual format for each type? I don't know vb
> so I'd appreciated for any help.
> Thanks
>|||Thanks a lot
How to format cell / data apprearecnce under a table
Hello All,
I uploaded custtable under the database, the data looks fine except that the name that apprears has a lot of distance e.g
it should be :
firstname lastname however the format appears very strange:
firstname lastname
firstname lastname
fistname lastname
Same is the case with the address, I need to adjust or format the apperance that appears on the cell. Is there a way/ sql statement to format the data under the table so that the apprearence looks okay.
I will really appreciate any sort of help on this one.
Thanks,
Rashi
Check the positioning properties of the grid/cell.
You could try trimming leading 'space' characters in the SELECT query, e.g., ltrim( FirstName ), ltrim( LastName ).