Connecting Tech Pros Worldwide Forums | Help | Site Map

Replace in a Select query doesn't work

Robert
Guest
 
Posts: n/a
#1: Nov 20 '05
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
Guest
 
Posts: n/a
#2: Nov 20 '05

re: Replace in a Select query doesn't work


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

Post the SELECT statement.

Mythran


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#3: Nov 20 '05

re: Replace in a Select query doesn't work


* "Robert" <anonymous@discussions.microsoft.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>
Guest
 
Posts: n/a
#4: Nov 20 '05

re: Replace in a Select query doesn't work


ok...
This is the query

SELECT ... ,

(select SUM(iif(isNumeric(replace
(ValoareInitiala, ',', '.')), replace
(ValoareInitiala, ',', '.'), 0))
FROM RezultateSedinte WHERE
RezultateSedinte.SedintaID>=Lot.IDSedintaStart AND
RezultateSedinte.SedintaID<=Lot.IDSedintaEnd AND
RezultateSedinte.ImuProID=ImuGr1.ID) AS ValIni,
....

FROM...
Robert
Guest
 
Posts: n/a
#5: Nov 20 '05

re: Replace in a Select query doesn't work


ok...
This is the query:

SELECT ... ,

(select SUM(iif(isNumeric(replace(Field, ',', '.')),
replace(Field, ',', '.'), 0))
FROM ... WHERE ...) AS ValIni,
.....

FROM...




(sorry for writing it twice...)
Guest
 
Posts: n/a
#6: Nov 20 '05

re: Replace in a Select query doesn't work


This is the query

SELECT ... ,

(select SUM(iif(isNumeric(replace(Field, ',', '.')),
replace(Field, ',', '.'), 0))
FROM ... WHERE ...) AS ValIni,
.....

FROM...

I use an ado recordset to open query
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#7: Nov 20 '05

re: Replace in a Select query doesn't work


* "Robert" <anonymous@discussions.microsoft.com> scripsit:[color=blue]
> This is the query:
>
> SELECT ... ,
>
> (select SUM(iif(isNumeric(replace(Field, ',', '.')),
> 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>
Guest
 
Posts: n/a
#8: Nov 20 '05

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


Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#9: Nov 20 '05

re: Replace in a Select query doesn't work


* <anonymous@discussions.microsoft.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.public.vb.database.ado.

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