Replace in a Select query doesn't work

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

    Replace in a Select query doesn't work

    Greetings.
    I have a sql query that works just fine in Access.
    There is at a certain point in that query a REPLACE(...)
    When I try to use this query in VB, it says:
    "Undefined function REPLACE in expression"

    What should I do?
    Thanks in advance
  • Mythran

    #2
    Re: Replace in a Select query doesn't work

    [color=blue]
    > What should I do?[/color]

    Post the SELECT statement.

    Mythran


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Replace in a Select query doesn't work

      * "Robert" <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
      > I have a sql query that works just fine in Access.
      > There is at a certain point in that query a REPLACE(...)
      > When I try to use this query in VB, it says:
      > "Undefined function REPLACE in expression"
      >
      > What should I do?[/color]

      Post code!

      --
      Herfried K. Wagner [MVP]
      <http://www.mvps.org/dotnet>

      Comment

      • Guest's Avatar

        #4
        Replace in a Select query doesn't work

        ok...
        This is the query

        SELECT ... ,

        (select SUM(iif(isNumer ic(replace
        (ValoareInitial a, ',', '.')), replace
        (ValoareInitial a, ',', '.'), 0))
        FROM RezultateSedint e WHERE
        RezultateSedint e.SedintaID>=Lo t.IDSedintaStar t AND
        RezultateSedint e.SedintaID<=Lo t.IDSedintaEnd AND
        RezultateSedint e.ImuProID=ImuG r1.ID) AS ValIni,
        ....

        FROM...

        Comment

        • Robert

          #5
          Re: Replace in a Select query doesn't work

          ok...
          This is the query:

          SELECT ... ,

          (select SUM(iif(isNumer ic(replace(Fiel d, ',', '.')),
          replace(Field, ',', '.'), 0))
          FROM ... WHERE ...) AS ValIni,
          .....

          FROM...




          (sorry for writing it twice...)

          Comment

          • Guest's Avatar

            #6
            Re: Replace in a Select query doesn't work

            This is the query

            SELECT ... ,

            (select SUM(iif(isNumer ic(replace(Fiel d, ',', '.')),
            replace(Field, ',', '.'), 0))
            FROM ... WHERE ...) AS ValIni,
            .....

            FROM...

            I use an ado recordset to open query

            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: Replace in a Select query doesn't work

              * "Robert" <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
              > This is the query:
              >
              > SELECT ... ,
              >
              > (select SUM(iif(isNumer ic(replace(Fiel d, ',', '.')),
              > replace(Field, ',', '.'), 0))
              > FROM ... WHERE ...) AS ValIni,
              > ....
              >
              > FROM...[/color]

              Are you sure you are talking about VB.NET?!

              --
              Herfried K. Wagner [MVP]
              <http://www.mvps.org/dotnet>

              Comment

              • Guest's Avatar

                #8
                Re: Replace in a Select query doesn't work

                you got me...
                :)

                Actually I am using VB6.
                But, i open that query from a dinamic ADO recordset.
                So... shouldn't be too different in .NET


                Comment

                • Herfried K. Wagner [MVP]

                  #9
                  Re: Replace in a Select query doesn't work

                  * <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
                  > you got me...
                  > :)
                  >
                  > Actually I am using VB6.
                  > But, i open that query from a dinamic ADO recordset.[/color]

                  Notice that there are groups for this technology available:
                  microsoft.publi c.vb.database.a do.

                  --
                  Herfried K. Wagner [MVP]
                  <http://www.mvps.org/dotnet>

                  Comment

                  Working...