Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Monday, March 26, 2012

Number to words

hi
I want to know how convert number to words or words to number
for example. if i give input 100, i have to get the output "one hundred"
is there any built in function available. need solution immediately.
regards
nlakkaRun the attached script in PUBS database and see if that's what you want. I didn't have enough time to debug it, so if you find anything fishy, - just let me know.|||OK, it has bugs, so hang on...|||Alright, now it's good to go (I think). A little roughy, but good enough for check generation and similar stuff.|||I have tried running the script but it should even translate the cents and not
e.g. 50/100.

Good luck|||I have tried running the script but it should even translate the cents and not
e.g. 50/100.

Good luck
Hey, Why don't you try this link (http://sqlkit.com/blogs/rudra/archive/2006/04/10/104.aspx) ? Just make two part according to the position of the '.' decimal ,and add regional customization according to your choice.
I will add that functionality very soon ...
And use this logic to make it ...

set @.s='2344.34'
set @.part1=substring(@.s,1,(len(@.s)-3))
set @.part2=substring(@.s,(len(@.s)-1),2)

and pass it to the function. Hope u will do that easily ;)

Friday, March 9, 2012

Nulls -conditional display of value in Visual Studio

I am trying to display one of 2 values based on an input parameter. I have
created a field which is supposed to evaluate the parameter and display the
appropriate field.
My code is as follows: =iif( Parameters!LastWeek.Value = "Y",
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value,
Fields!Measures_M9N_MTD.Value)
When I preview my report and select "Y" as the parameter, my field displays
nothing. I have checked the data and know there is a value in the field
represented by the "true" portion of my statement.
If I change the staement to this:=iif( Parameters!LastWeek.Value = "Y",
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value, 0)
I actually get the value I am expecting.
My conclusion is the data in the "false" portion of the statement is
actually null or non-existant. I think this is causing my statement to
malfunction. How do I account for this and make my statement work properly?
There will eventually be data in the field represented in the "false"
portion of the statement. The data will reside in either/or both depending
on the time of month.
Thank you... PB> My conclusion is the data in the "false" portion of the statement is
> actually null or non-existant. I think this is causing my statement to
> malfunction.
Assuming this conclusion is correct, you could use a nested IIF() test using
the ISNOTHING() function, like this:
=iif( Parameters!LastWeek.Value = "Y",
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value,
iif(ISNOTHING( Fields!Measures_M9N_MTD.Value), 0,
Fields!Measures_M9N_MTD.Value) )
... however (still assuming your conclusion about why it's not working is
correct) it might be safer to assume that *either* value could be missing,
so you could do the test in both places:
=iif( Parameters!LastWeek.Value = "Y",
iif(ISNOTHING(Fields!Measures_M30N_MTD_Last_Week_of_Month.Value),0,
Fields!Measures_M30N_MTD_Last_Week_of_Month.Value),
iif(ISNOTHING(Fields!Measures_M9N_MTD.Value), 0,
Fields!Measures_M9N_MTD.Value) )
... double-however <g> when you look at it this way, it might be simpler to
do the same work in your data query. IOW use ISNULL() or COALESCE() in your
SELECT statement, to provide a default value for values that might be
missing, before you get to the report level.
Regards,
>L<
"ppbedz" <ppbedz@.discussions.microsoft.com> wrote in message
news:7F96FEB5-806D-4761-8077-4C3A7B85973D@.microsoft.com...
>I am trying to display one of 2 values based on an input parameter. I have
> created a field which is supposed to evaluate the parameter and display
> the
> appropriate field.
> My code is as follows: =iif( Parameters!LastWeek.Value = "Y",
> Fields!Measures_M30N_MTD_Last_Week_of_Month.Value,
> Fields!Measures_M9N_MTD.Value)
> When I preview my report and select "Y" as the parameter, my field
> displays
> nothing. I have checked the data and know there is a value in the field
> represented by the "true" portion of my statement.
> If I change the staement to this:=iif( Parameters!LastWeek.Value = "Y",
> Fields!Measures_M30N_MTD_Last_Week_of_Month.Value, 0)
> I actually get the value I am expecting.
> My conclusion is the data in the "false" portion of the statement is
> actually null or non-existant. I think this is causing my statement to
> malfunction. How do I account for this and make my statement work
> properly?
> There will eventually be data in the field represented in the "false"
> portion of the statement. The data will reside in either/or both
> depending
> on the time of month.
> Thank you... PB

Saturday, February 25, 2012

Null value for Web Service task input

I'm attempting to use the Web Service task to call a method provided by a vendor. The inputs are all simple types so that helps a lot, but for one input it's a string array. If I enter a single string value for a given id using the array dialog, the method works fine.

However if I try to change the input to use a variable to provide the value it fails. I'm assuming that you can't create a variable to return a string array. Please let me know if this is the case or if I'm missing something obvious ;-)

In addition, is there a way to specify a null value for an input? Currently there doesn't appear to be a way to do this in SP2. I tried leaving the string empty which didn't work and I tried using a variable with expression "NULL(DT_WSTR, 1252)" but that failed too.

You should be able to store an array of strings in a variable typed as Object. Not sure how well that will pass to the web service though.|||

Thanks for your reply John. As you suggested, I changed the variable type to object and assigned a string array to it. I was skeptical that it would work, but when I used that in the Web Service it worked! So many thanks to you!

Also I discovered a way to pass null values for parameters which is a bit unorthodox. You check the variable option for the input, but you don't select a variable and then that parameter is excluded from the request.

However there does appear to be one final obstacle which is that the timeout setting doesn't appear to work. Someone with a similar issue posted it at http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=277689 and I have validated it.

null value

I have a char field which I check the "allow null" property and when I tried
to input an empty string that field, it always give me the following msg:
"You tried to assign Null value to a variable that isn't a Variant data
type"
But if I run it in an update query and I don't get the same message. I am
using SQL2000 and access 97 query. Please help. Thanks._eric clapton wrote:
> I have a char field which I check the "allow null" property and when
> I tried to input an empty string that field, it always give me the
> following msg:
> "You tried to assign Null value to a variable that isn't a Variant
> data type"
> But if I run it in an update query and I don't get the same message.
> I am using SQL2000 and access 97 query. Please help. Thanks.
You can't input a zero-length string from the GUI because Access automatically
strips trailing blanks. The append query doesn't do this which is why it works.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

null value

I have a char field which I check the "allow null" property and when I tried
to input an empty string that field, it always give me the following msg:
"You tried to assign Null value to a variable that isn't a Variant data
type"
But if I run it in an update query and I don't get the same message. I am
using SQL2000 and access 97 query. Please help. Thanks._eric clapton wrote:
> I have a char field which I check the "allow null" property and when
> I tried to input an empty string that field, it always give me the
> following msg:
> "You tried to assign Null value to a variable that isn't a Variant
> data type"
> But if I run it in an update query and I don't get the same message.
> I am using SQL2000 and access 97 query. Please help. Thanks.
You can't input a zero-length string from the GUI because Access automatical
ly
strips trailing blanks. The append query doesn't do this which is why it wo
rks.
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

null value

I have a char field which I check the "allow null" property and when I tried
to input an empty string that field, it always give me the following msg:
"You tried to assign Null value to a variable that isn't a Variant data
type"
But if I run it in an update query and I don't get the same message. I am
using SQL2000 and access 97 query. Please help. Thanks.
_eric clapton wrote:
> I have a char field which I check the "allow null" property and when
> I tried to input an empty string that field, it always give me the
> following msg:
> "You tried to assign Null value to a variable that isn't a Variant
> data type"
> But if I run it in an update query and I don't get the same message.
> I am using SQL2000 and access 97 query. Please help. Thanks.
You can't input a zero-length string from the GUI because Access automatically
strips trailing blanks. The append query doesn't do this which is why it works.
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com