Hi,
Please let me know is it possible to achieve the below query in MS Access.
I have tried with " " (double quote) also in the replace. it doesn't help me.
SELECT * FROM dbo_Facility WHERE (REPLACE(REPLACE(REPLACE(NAME,',',''),'.',''),'''' ,'') LIKE 'jambai %')
Thanks
Jambai
12 8974
Hi,
Please let me know is it possible to achieve the below query in MS Access.
I have tried with " " (double quote) also in the replace. it doesn't help me.
SELECT * FROM dbo_Facility WHERE (REPLACE(REPLACE(REPLACE(NAME,',',''),'.',''),'''' ,'') LIKE 'jambai %')
Thanks
Jambai
show me some data and description of thy tbl
Unless this is a pass thru query you will need to change % to * which is the wildcard in Access.
Replace function looks ok but I would put NAME in square brackets and your closing bracket is in the wrong place. Try this ... -
-
SELECT * FROM dbo_Facility
-
WHERE (REPLACE(REPLACE(REPLACE([NAME],",",""),".",""),"'",""))
-
LIKE "jambai*")
-
Mary
Unless this is a pass thru query you will need to change % to * which is the wildcard in Access.
Replace function looks ok but I would put NAME in square brackets and your closing bracket is in the wrong place. Try this ... -
-
SELECT * FROM dbo_Facility
-
WHERE (REPLACE(REPLACE(REPLACE([NAME],",",""),".",""),"'",""))
-
LIKE "jambai*")
-
Mary
I tried your query, it didn't work.
Data type mismatch in criteria expression was the error message. And the data type of the column is text. One more thing the table is a linked table from SQL 2000.
Thanks
jambai
I tried your query, it didn't work.
Data type mismatch in criteria expression was the error message. And the data type of the column is text. One more thing the table is a linked table from SQL 2000.
Thanks
jambai
Did you copy and paste the code exactly?
Try this ... -
-
SELECT dbo_Facility.*,
-
(REPLACE(REPLACE(REPLACE(dbo_Facility.[NAME],",",""),".",""),"'",""))
-
FROM dbo_Facility
-
WHERE (REPLACE(REPLACE(REPLACE(dbo_Facility.[NAME],",",""),".",""),"'",""))
-
LIKE "jambai*")
NeoPa 32,534
Expert Mod 16PB
Hi,
Please let me know is it possible to achieve the below query in MS Access.
I have tried with " " (double quote) also in the replace. it doesn't help me.
SELECT * FROM dbo_Facility WHERE (REPLACE(REPLACE(REPLACE(NAME,',',''),'.',''),'''' ,'') LIKE 'jambai %')
Thanks
Jambai
Replace will not work on versions of Access prior to 2K.
The '%' as a wildcard is only right in 2003 or later and where set to full ANSI compatibility mode.
Replace will not work on versions of Access prior to 2K.
The '%' as a wildcard is only right in 2003 or later and where set to full ANSI compatibility mode.
Are you talking about the REPLACE in left side of the WHERE caluse. Because the Replace in the right side of the where clause is working fine
Thanks
Jambai
NeoPa 32,534
Expert Mod 16PB
I'm unclear what you'd be referring to as the left or right sides of the WHERE clause. Nor do I know which version of Access you're using.
I was simply mentioning, for reference, that Replace() doesn't exist in versions prior to 2K. If you're telling me you use Access 97 or earlier and it works for you then I'm surprised :confused:
I'm unclear what you'd be referring to as the left or right sides of the WHERE clause. Nor do I know which version of Access you're using.
I was simply mentioning, for reference, that Replace() doesn't exist in versions prior to 2K. If you're telling me you use Access 97 or earlier and it works for you then I'm surprised :confused:
I am using MS Access 2002 and the replace is working fine in the below query
SELECT * FROM dbo_Facility WHERE [NAME] Like Replace('jambai',',','')));
I am wondering ist possible to create the below query.
Please see the marked code, this was the one I referred as left side of the where clause
SELECT * FROM dbo_Facility WHERE (REPLACE([NAME],',','') LIKE 'jambai%'
Thanks
Jambai
NeoPa 32,534
Expert Mod 16PB
Ah, I understand what you mean now.
Yes.
...is the simple answer. SQL will deal with it on either side in that sense :)
Ah, I understand what you mean now.
Yes.
...is the simple answer. SQL will deal with it on either side in that sense :)
Thanks NeoPa,
Please let me know how to achive the same query in MS ACCESS 2002
SELECT * FROM dbo_Facility WHERE (REPLACE([NAME],',','') LIKE 'jambai%'
Thanks
Jambai
NeoPa 32,534
Expert Mod 16PB
Thanks NeoPa,
Please let me know how to achive the same query in MS ACCESS 2002 - SELECT *
-
FROM dbo_Facility
-
WHERE (Replace([NAME],',','') Like 'jambai%'
Thanks
Jambai
Exactly as you have it should work fine (except you should replace the % with a *).
Exactly as you have it should work fine (except you should replace the % with a *).
Data type mismatch in criteria expression was the error message, when I tried that query
Yes I replaced the % with *.
Thanks
Kumar
Sign in to post your reply or Sign up for a free account.
Similar topics
by: A.V.C. |
last post by:
Hello,
I found members of this group very helpful for my last queries.
Have one problem with CASE. I can use the column name alias in Order By Clause
but unable to use it in WHERE CLAUSE.
PLS...
|
by: comp.lang.php |
last post by:
$orderBy = 's.app_date desc, s.last_name asc, s.first_name asc, s.mi
asc';
if ($_REQUEST) {
$ascArray = array('asc' => 'desc', 'desc' => 'asc'); // ARRAY OF
ALL ORDERING POSSIBILITIES
$junk =...
|
by: Curtiosity |
last post by:
I have done a create or replace view called creditcard1. If I do a "select * from creditcard1" it retrieves the data just fine. If I try to do a statement where I am listing the column names it...
|
by: Captain Dondo |
last post by:
I have an array(?) (sorry, I'm new* to python so I'm probably mangling
the terminology) that looks like this:
I want to replace every instance of 'tooth.seiner.lan' with 'localhost'.
There...
|
by: Jim.Mueksch |
last post by:
I am having a problem with using calculated values in a WHERE clause.
My query is below. DB2 gives me this error message: Error: SQL0206N
"APPRAISAL_LESS_PRICE" is not valid in the context where...
|
by: chrisdavis |
last post by:
I'm trying to filter by query or put those values in a distinct query
in a where clause in some sort of list that it goes through but NOT at
the same time. Example:
ROW1
ROW2
ROW3
ROW4 ,...
|
by: pwiegers |
last post by:
Hi,
I'm trying to use the result of a conditional statement in a where
clause, but i'm getting 1)nowhere 2) desperate :-)
The query is simple:
--------
SELECT
idUser,...
|
by: JackpipE |
last post by:
Here is my replace query and I need to run this on every column in my
table. Right now I manually enter the column name (_LANGUAGES_SPOKEN)
but this is time consuming and would like to automate...
|
by: tkltechy |
last post by:
I have a sql query that unions two recordsets. It works when I don't try to adjust the ORDER BY clause using the replace function. However, I want to ensure that a certain item in the list always...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |