Showing posts with label string. Show all posts
Showing posts with label string. Show all posts

Friday, March 23, 2012

Image data type to character string

I have a table with an image datatype field.

When I retrieve it it displays as a binary array. How do I convert that array back and forth to get the underlying text?

Post the SQL statement used in this regard, you need to use READTEXT statement, also http://www.codeproject.com/cs/database/ImageSaveInDataBase.asp fyi..

If you are using any application to display that image column then refer to http://www.akadia.com/services/dotnet_load_blob.html link for more information.

Wednesday, March 21, 2012

Image Datatype as Report Parmeter !

I have a lengthy string which has to be passed as Image datatype to the
report so that it is not truncated.
Can it be possible '
chansImage data types are not allowed as parameters...You are limited to a
relatively small list of data types... However you might add the parameter
value to the database in an image column and pass the key value as a
parameter, then the report could look up the image...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Chans" <Chans@.discussions.microsoft.com> wrote in message
news:265D8A97-D974-4557-85B9-2D2EFAF37A61@.microsoft.com...
>I have a lengthy string which has to be passed as Image datatype to the
> report so that it is not truncated.
> Can it be possible '
> chans

Image data type to character string

I have a table with an image datatype field.

When I retrieve it it displays as a binary array. How do I convert that array back and forth to get the underlying text?

Post the SQL statement used in this regard, you need to use READTEXT statement, also http://www.codeproject.com/cs/database/ImageSaveInDataBase.asp fyi..

If you are using any application to display that image column then refer to http://www.akadia.com/services/dotnet_load_blob.html link for more information.

Friday, February 24, 2012

IIF String Contains a value?

I want to create an IIF expression that changes the color of a field based on if a string value contains a 4 or 5 Any ideas on how to accomplish this?

Hi,

You can write an iif() expression in the background color property of that field.

The following expression will help:

iif(instr("string5",5) or instr("string4",4),"Gray","White")

You can change the color by choosing what u require from the constants provided else custon color.

Somiya

|||Thanks, but I think I need a little more help. The value I need to look for will be in a string like "3,4,6,8" so I think I need the Like conparison function, but I'm not sure of the syntax

The psudo code is this:

If instrI(String) contains a 4 or instrI(String) contains 5 display in Red else Black

Do you know what the syntax should be for IIF with a like conparison?|||

i think the same expression should work in a way similar to Like.

An iff() expression with Like operator would be in this case:

iif(("3,4,6,8" Like "*4*") or ("3,4,6,8" Like "*5*") ,"Red",Black")

* is for any 4 preceeding and followed with any number of characters

Somiya

Sunday, February 19, 2012

IIF Issues

I am trying to format dates that are in string format. When I use:
=IIF(Fields!MyDate.Value = "","EMPTY","STRING")
I get EMPTY and STRING right where they should appear. When I use:
=IIF(Fields!MyDate.Value = "","",Format((Convert.ToDateTime(Fields!MyDate.Value)), "MMM. d, yyyy"))
I get #Error for all of the empty strings and correctly formatted dates for
everything else... what am I doing wrong?Try inserting spaces( i used 5 spaces)...I had the same problem, it does not
seem to like "".
~aparna
"MER78" wrote:
> I am trying to format dates that are in string format. When I use:
> =IIF(Fields!MyDate.Value = "","EMPTY","STRING")
> I get EMPTY and STRING right where they should appear. When I use:
> =IIF(Fields!MyDate.Value => "","",Format((Convert.ToDateTime(Fields!MyDate.Value)), "MMM. d, yyyy"))
> I get #Error for all of the empty strings and correctly formatted dates for
> everything else... what am I doing wrong?|||IIF always evaluates two sides of an expression, which is where the error
occurs. You can create a custom code function that has a regular If
statement, and call it like so:
=code.MyFunctionName(Fields!MyDate.Value)
Right-click on the report background and click Properties to get to the code
area.
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"MER78" <MER78@.discussions.microsoft.com> wrote in message
news:02AA454F-2678-4E0E-A910-F639933B6788@.microsoft.com...
>I am trying to format dates that are in string format. When I use:
> =IIF(Fields!MyDate.Value = "","EMPTY","STRING")
> I get EMPTY and STRING right where they should appear. When I use:
> =IIF(Fields!MyDate.Value => "","",Format((Convert.ToDateTime(Fields!MyDate.Value)), "MMM. d, yyyy"))
> I get #Error for all of the empty strings and correctly formatted dates
> for
> everything else... what am I doing wrong?|||YUCK... that's so much more of a hassle... what's the point of creating
branching code if it executes all cases?
"Jeff A. Stucker" wrote:
> IIF always evaluates two sides of an expression, which is where the error
> occurs. You can create a custom code function that has a regular If
> statement, and call it like so:
> =code.MyFunctionName(Fields!MyDate.Value)
> Right-click on the report background and click Properties to get to the code
> area.
> Cheers,
> '(' Jeff A. Stucker|||I've had success using = nothing
Hope this helps.
"MER78" wrote:
> YUCK... that's so much more of a hassle... what's the point of creating
> branching code if it executes all cases?
> "Jeff A. Stucker" wrote:
> > IIF always evaluates two sides of an expression, which is where the error
> > occurs. You can create a custom code function that has a regular If
> > statement, and call it like so:
> >
> > =code.MyFunctionName(Fields!MyDate.Value)
> >
> > Right-click on the report background and click Properties to get to the code
> > area.
> >
> > Cheers,
> >
> > '(' Jeff A. Stucker|||I've had success using = nothing
hth
"MER78" wrote:
> YUCK... that's so much more of a hassle... what's the point of creating
> branching code if it executes all cases?
> "Jeff A. Stucker" wrote:
> > IIF always evaluates two sides of an expression, which is where the error
> > occurs. You can create a custom code function that has a regular If
> > statement, and call it like so:
> >
> > =code.MyFunctionName(Fields!MyDate.Value)
> >
> > Right-click on the report background and click Properties to get to the code
> > area.
> >
> > Cheers,
> >
> > '(' Jeff A. Stucker|||I tend to agree with you. But that's how IIF was designed eons ago for
VB/VBScript, not really for branching, but inline evaluation and population
of data.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"MER78" <MER78@.discussions.microsoft.com> wrote in message
news:9925D007-E1CD-47C6-8A48-FE06F826CDD1@.microsoft.com...
> YUCK... that's so much more of a hassle... what's the point of creating
> branching code if it executes all cases?
> "Jeff A. Stucker" wrote:
>> IIF always evaluates two sides of an expression, which is where the error
>> occurs. You can create a custom code function that has a regular If
>> statement, and call it like so:
>> =code.MyFunctionName(Fields!MyDate.Value)
>> Right-click on the report background and click Properties to get to the
>> code
>> area.
>> Cheers,
>> '(' Jeff A. Stucker