Showing posts with label converting. Show all posts
Showing posts with label converting. Show all posts

Thursday, March 29, 2012

Formula in flaot field

I have a float field and need the data to present itself as a datetime. I have been unsuccessful at converting the entire field to datetime so I thought I would try a formula but have had no success. Can this be done?

I have data like so:

100599
10699
120597
etc...

and need to hit them as though they were datetime for order by and such...

or an 'in query' conversion...

ThanksI came up with a solution, thanks anyway.sql

Monday, March 19, 2012

Formatting a string from the code

I have a textbox that displays the amout of free disk space in megabytes.
I'm working on converting it to gigabytes and if it's less that one gig, I
want to display the string "Critical" bold and in red. Can this be done?
Thanks.This can certainly be done. Where do you want to display the text
'Critical'? If you have another textbox you would use an expression to
determine the value of that checkbox. for example if you were getting the
value from a dataset you would have a similar code to the following in the
expression editor:
=IIf(Fields!Number_Of_Megs < 1024,"","Critical")
Hope this helps
"chalexan" wrote:
> I have a textbox that displays the amout of free disk space in megabytes.
> I'm working on converting it to gigabytes and if it's less that one gig, I
> want to display the string "Critical" bold and in red. Can this be done?
> Thanks.|||Bret or anyone else,
Thanks for the reply. Any suggestions on changing the font's color to red
if it's critical and making it bold?
--Chad|||You will have to do this from the report designer. You can select the
textbox that the text is in and go to the textbox properties. (right click
and properties) From here you can select the format for this text box... A
nice feature is using the Expression Editor to select the font color. This
will allow you to use an IIF() statement to have the font red or black. You
can allow do this with the font weight.
Example of formatting font color in expression editor: (you would put this
in the format expression for the font-color in the designer)
=IIf(Fields!Number_Of_Megs < 1024,"black","red")
"chalexan" wrote:
> Bret or anyone else,
> Thanks for the reply. Any suggestions on changing the font's color to red
> if it's critical and making it bold?
> --Chad|||Bret,
Wow! I thought that the "IIf(" was a typo. That functionality can be very
useful. Thank you so much for explaining that to me.
--Chad

Sunday, February 26, 2012

Format expressions(converting seconds to minutes)

can any one tell me how to change seconds to minutes by using if condition in rss...

for example i have value of seconds=50, minutes should come like this 50/60=0.833333.... i got the answer ... but the problem is how to roundoff or truncate the minutes to 0.83 or 0.84 from 0.8333333...

Thanks in anticipation

raj

using this expression i have got it ....

=iif( Fields!duration.Value=0,0,format(Fields!duration.Value/60,"0.00"))

Sunday, February 19, 2012

format 0.00 decimal value

Is there any option/settings in SQL server to return 0 decimal value as
"0.00"
not
".00"
I can do it by converting all results to varchar(), but is there any easy
way? may be server settings?
thanks
L
Formatting of decimal data is done by the front end, not the server.
So the problem is with Query Analyzer, or whatever tool you are using.
If it is QA there is no feature like you are asking for.
Roy Harvey
Beacon Falls, CT
On Wed, 29 Nov 2006 13:43:01 -0800, LLT
<LLT@.discussions.microsoft.com> wrote:

>Is there any option/settings in SQL server to return 0 decimal value as
>"0.00"
>not
>".00"
>I can do it by converting all results to varchar(), but is there any easy
>way? may be server settings?
>thanks
>L
|||I am using QA. The same in DTS when I extract data into txt file. Strange,
but float is returned with leading 0 as "0.00", decimal and money without as
".00". When number converted to string using cast() or str() leading 0 is
shown for all numbers.
You can run in in QA.
select 'money, with varchar cast', cast(cast (0.00 as money) as varchar(10))
select 'money, no varchar cast', cast(0.00 as money)
select 'decimal(10,2) with varchar cast', cast(cast (0.00 as decimal(10,2))
as varchar(10))
select 'decimal, no varchar cast', cast(0.00 as decimal(10,2))
select 'float, with varchar cast', cast(cast (0.00 as float) as varchar(10))
select 'float, no varchar cast', cast(0.00 as float)
"Roy Harvey" wrote:

> Formatting of decimal data is done by the front end, not the server.
> So the problem is with Query Analyzer, or whatever tool you are using.
> If it is QA there is no feature like you are asking for.
> Roy Harvey
> Beacon Falls, CT
> On Wed, 29 Nov 2006 13:43:01 -0800, LLT
> <LLT@.discussions.microsoft.com> wrote:
>

format 0.00 decimal value

Is there any option/settings in SQL server to return 0 decimal value as
"0.00"
not
".00"
I can do it by converting all results to varchar(), but is there any easy
way? may be server settings?
thanks
LFormatting of decimal data is done by the front end, not the server.
So the problem is with Query Analyzer, or whatever tool you are using.
If it is QA there is no feature like you are asking for.
Roy Harvey
Beacon Falls, CT
On Wed, 29 Nov 2006 13:43:01 -0800, LLT
<LLT@.discussions.microsoft.com> wrote:

>Is there any option/settings in SQL server to return 0 decimal value as
>"0.00"
>not
>".00"
>I can do it by converting all results to varchar(), but is there any easy
>way? may be server settings?
>thanks
>L|||I am using QA. The same in DTS when I extract data into txt file. Strange,
but float is returned with leading 0 as "0.00", decimal and money without as
".00". When number converted to string using cast() or str() leading 0 is
shown for all numbers.
You can run in in QA.
select 'money, with varchar cast', cast(cast (0.00 as money) as varchar(10)
)
select 'money, no varchar cast', cast(0.00 as money)
select 'decimal(10,2) with varchar cast', cast(cast (0.00 as decimal(10,2))
as varchar(10))
select 'decimal, no varchar cast', cast(0.00 as decimal(10,2))
select 'float, with varchar cast', cast(cast (0.00 as float) as varchar(10))
select 'float, no varchar cast', cast(0.00 as float)
"Roy Harvey" wrote:

> Formatting of decimal data is done by the front end, not the server.
> So the problem is with Query Analyzer, or whatever tool you are using.
> If it is QA there is no feature like you are asking for.
> Roy Harvey
> Beacon Falls, CT
> On Wed, 29 Nov 2006 13:43:01 -0800, LLT
> <LLT@.discussions.microsoft.com> wrote:
>
>