Counting the number of occurences in a string

T

Thuy Pham

I need to count the number of times "back order date changed" is displayed in
a field.

For example

Text field Count

"Back order date changed"... 2

"Back order date changed"....
 
D

Duane Hookom

Is this the only value that might be in the field or is it just part of the
field value? You can try something like:
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] ="Back order date changed";
or
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] Like "*Back order date changed*";
 
T

Thuy Pham

How do i display this information below in a query design view?

Thanks

Thuy

Duane Hookom said:
Is this the only value that might be in the field or is it just part of the
field value? You can try something like:
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] ="Back order date changed";
or
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] Like "*Back order date changed*";


--
Duane Hookom
Microsoft Access MVP


Thuy Pham said:
I need to count the number of times "back order date changed" is displayed in
a field.

For example

Text field Count

"Back order date changed"... 2

"Back order date changed"....
 
D

Duane Hookom

Change the names to your actual names and paste the sql into your query's sql
view. Then view the design view.
--
Duane Hookom
Microsoft Access MVP


Thuy Pham said:
How do i display this information below in a query design view?

Thanks

Thuy

Duane Hookom said:
Is this the only value that might be in the field or is it just part of the
field value? You can try something like:
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] ="Back order date changed";
or
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] Like "*Back order date changed*";


--
Duane Hookom
Microsoft Access MVP


Thuy Pham said:
I need to count the number of times "back order date changed" is displayed in
a field.

For example

Text field Count

"Back order date changed"... 2

"Back order date changed"....
 
T

Thuy Pham

Thanks, it works!

Duane Hookom said:
Change the names to your actual names and paste the sql into your query's sql
view. Then view the design view.
--
Duane Hookom
Microsoft Access MVP


Thuy Pham said:
How do i display this information below in a query design view?

Thanks

Thuy

Duane Hookom said:
Is this the only value that might be in the field or is it just part of the
field value? You can try something like:
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] ="Back order date changed";
or
SELECT Count(*) as NumOf
FROM [tblNoNameGiven]
WHERE [a field] Like "*Back order date changed*";


--
Duane Hookom
Microsoft Access MVP


:

I need to count the number of times "back order date changed" is displayed in
a field.

For example

Text field Count

"Back order date changed"... 2

"Back order date changed"....
 
Top