Counting the number of occurences in a string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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"....
 
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*";
 
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"....
 
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"....
 
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"....
 
Back
Top