G
Guest
Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
field?
Thanks in advance,
Bonnie
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
Bonnie said:Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
Bonnie said:Thanks Karl, that's excellent. Where would I put the results of the
calculation in a query?
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
Bonnie said:Can anyone tell me the SQL syntax to count how many blank spaces are in
a
field?
Thanks in advance,
Bonnie
..with.norway said:Any blank space in the query grid will do <g>
or in sql
SELECT YourField, Len([YourField]) - Len(Replace([YourField],' ','')) As
CountBlanks
FROM YourTable
Pieter
Bonnie said:Thanks Karl, that's excellent. Where would I put the results of the
calculation in a query?
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
:
Can anyone tell me the SQL syntax to count how many blank spaces are in
a
field?
Thanks in advance,
Bonnie
Taryn said:I have one quick question how many addresses can u add in the address book?
- Amanda Kelski
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
Bonnie said:Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
Bonnie said:This suggestion was very helpful. I am just having a problem using it in a
query. It appears to work for a second and then I get a data type mismatch
error. Any ideas?
Thanks in advance.
Bonnie
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
Bonnie said:Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
KARL DEWEY said:Post your query SQL.
What is the datatype of the field you are using it on?
--
KARL DEWEY
Build a little - Test a little
Bonnie said:This suggestion was very helpful. I am just having a problem using it in
a
query. It appears to work for a second and then I get a data type
mismatch
error. Any ideas?
Thanks in advance.
Bonnie
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
:
Can anyone tell me the SQL syntax to count how many blank spaces are
in a
field?
Thanks in advance,
Bonnie
KARL DEWEY said:Post your query SQL.
What is the datatype of the field you are using it on?
--
KARL DEWEY
Build a little - Test a little
Bonnie said:This suggestion was very helpful. I am just having a problem using it in a
query. It appears to work for a second and then I get a data type mismatch
error. Any ideas?
Thanks in advance.
Bonnie
KARL DEWEY said:Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
:
Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
Bonnie said:Hi -
Sorry it's taken me so long, got side tracked with another issue but I would
still love to work this out. Here's the SQL code:
UPDATE MASTER SET MASTER.CITY = Trim(Left(MASTER.CSZ,InStr(MASTER.CSZ,"
")-1)), MASTER.STATE = Trim(Mid(MASTER.CSZ,InStr(MASTER.CSZ," ")+1,2)),
MASTER.ZIP = Trim(Right(MASTER.CSZ,Len(MASTER.CSZ)-InStrRev(MASTER.CSZ," ")))
WHERE (((Len([CSZ])-Len(Replace([CSZ]," ","")))="2"));
CSZ field is Text, field size 100
CITY field is Text, field size 35
STATE field is Text, field size 2
ZIP field is Text, field size 15
I also tried Doug's suggestion with the IIF(IsNull but get a "wrong number
of arguments" error. The error on the original query was "data type mismatch
in criteria expersion."
Thanks in advance for any help you can give.
Bonnie
KARL DEWEY said:Post your query SQL.
What is the datatype of the field you are using it on?
--
KARL DEWEY
Build a little - Test a little
Bonnie said:This suggestion was very helpful. I am just having a problem using it in a
query. It appears to work for a second and then I get a data type mismatch
error. Any ideas?
Thanks in advance.
Bonnie
:
Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
:
Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
Bonnie said:Hi -
Sorry it's taken me so long, got side tracked with another issue but I
would
still love to work this out. Here's the SQL code:
UPDATE MASTER SET MASTER.CITY = Trim(Left(MASTER.CSZ,InStr(MASTER.CSZ,"
")-1)), MASTER.STATE = Trim(Mid(MASTER.CSZ,InStr(MASTER.CSZ," ")+1,2)),
MASTER.ZIP = Trim(Right(MASTER.CSZ,Len(MASTER.CSZ)-InStrRev(MASTER.CSZ,"
")))
WHERE (((Len([CSZ])-Len(Replace([CSZ]," ","")))="2"));
CSZ field is Text, field size 100
CITY field is Text, field size 35
STATE field is Text, field size 2
ZIP field is Text, field size 15
I also tried Doug's suggestion with the IIF(IsNull but get a "wrong number
of arguments" error. The error on the original query was "data type
mismatch
in criteria expersion."
Thanks in advance for any help you can give.
Bonnie
KARL DEWEY said:Post your query SQL.
What is the datatype of the field you are using it on?
--
KARL DEWEY
Build a little - Test a little
Bonnie said:This suggestion was very helpful. I am just having a problem using it
in a
query. It appears to work for a second and then I get a data type
mismatch
error. Any ideas?
Thanks in advance.
Bonnie
:
Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
:
Can anyone tell me the SQL syntax to count how many blank spaces
are in a
field?
Thanks in advance,
Bonnie
KARL DEWEY said:expersion."
Your problem is in this --
WHERE (((Len([CSZ])-Len(Replace([CSZ]," ","")))="2"));
It should be ---
WHERE (((Len([CSZ])-Len(Replace([CSZ]," ","")))=2));
You are looking for a number and when you put it in quotes you are saying it
is text.
--
KARL DEWEY
Build a little - Test a little
Bonnie said:Hi -
Sorry it's taken me so long, got side tracked with another issue but I would
still love to work this out. Here's the SQL code:
UPDATE MASTER SET MASTER.CITY = Trim(Left(MASTER.CSZ,InStr(MASTER.CSZ,"
")-1)), MASTER.STATE = Trim(Mid(MASTER.CSZ,InStr(MASTER.CSZ," ")+1,2)),
MASTER.ZIP = Trim(Right(MASTER.CSZ,Len(MASTER.CSZ)-InStrRev(MASTER.CSZ," ")))
WHERE (((Len([CSZ])-Len(Replace([CSZ]," ","")))="2"));
CSZ field is Text, field size 100
CITY field is Text, field size 35
STATE field is Text, field size 2
ZIP field is Text, field size 15
I also tried Doug's suggestion with the IIF(IsNull but get a "wrong number
of arguments" error. The error on the original query was "data type mismatch
in criteria expersion."
Thanks in advance for any help you can give.
Bonnie
KARL DEWEY said:Post your query SQL.
What is the datatype of the field you are using it on?
--
KARL DEWEY
Build a little - Test a little
:
This suggestion was very helpful. I am just having a problem using it in a
query. It appears to work for a second and then I get a data type mismatch
error. Any ideas?
Thanks in advance.
Bonnie
:
Len([YourField]) - Len(Replace([YourField]," ",""))
--
KARL DEWEY
Build a little - Test a little
:
Can anyone tell me the SQL syntax to count how many blank spaces are in a
field?
Thanks in advance,
Bonnie
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.