LIKE operation on SYSTEM.DECIMAL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ksedran

    #1

    LIKE operation on SYSTEM.DECIMAL

    Hello all,

    I am having an issue with a dataview.RowFil ter expression.

    I am trying to filter a dataview with the following:

    DV_TXN.RowFilte r = "MCC LIKE '" & MCCselection & "'"

    But get the following error:
    "Cannot perform 'Like' operation on System.Decimal and System.String"

    The datatype of the "MCC" column in the oracle table is NUMBER.

    Any ideas on how I can filter this??

    Thanks in advance!


    --
    Kevin
  • W.G. Ryan eMVP

    #2
    Re: LIKE operation on SYSTEM.DECIMAL

    You can create an expression column on your datatable that simply converts
    the decimal column to string and you can compare on this new column.

    --
    W.G. Ryan, MVP

    www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
    "ksedran" <ksedran@discus sions.microsoft .com> wrote in message
    news:A60FDB6F-E0FF-4565-97F6-F7EA614F8F77@mi crosoft.com...[color=blue]
    > Hello all,
    >
    > I am having an issue with a dataview.RowFil ter expression.
    >
    > I am trying to filter a dataview with the following:
    >
    > DV_TXN.RowFilte r = "MCC LIKE '" & MCCselection & "'"
    >
    > But get the following error:
    > "Cannot perform 'Like' operation on System.Decimal and System.String"
    >
    > The datatype of the "MCC" column in the oracle table is NUMBER.
    >
    > Any ideas on how I can filter this??
    >
    > Thanks in advance!
    >
    >
    > --
    > Kevin[/color]


    Comment

    • Cor Ligthert

      #3
      Re: LIKE operation on SYSTEM.DECIMAL

      To add a little bit to the text from Bill.
      [color=blue]
      > You can create an expression column on your datatable that simply converts
      > the decimal column to string and you can compare on this new column.[/color]

      You can create an extra column in your datatable. Direct with that command
      you can use the expression to fill the data that than converts the decimal
      column to string. Than you can compare on this new column.

      By the way, did you know that there are newsgroups
      microsoft.publi c.dotnet.framew ork.adonet
      microsoft.publi c.dotnet.langua ges.vb

      That are newsgroups more specialized on questions like this, where for this
      question the first one is in my opinion the right one.

      Cor


      Comment

      Working...