[email protected]; smith,patti ; [email protected] - Criteria?

S

Shamrox

I have a field with
(e-mail address removed); smith,patti ; (e-mail address removed)

Im interested in pulling the smith,patti only.

I tried numerous criteria in my query but can't seem to get it. Such things
as:
Like (";"(*,*)";") ....but just cant figure it out.
or go the other way and pull the @ entries:
Like ";*@*.*;" .....but that wont work for me either


Anyone got any suggestions? Thanx!
 
J

John W. Vinson

I have a field with
(e-mail address removed); smith,patti ; (e-mail address removed)

Im interested in pulling the smith,patti only.

I tried numerous criteria in my query but can't seem to get it. Such things
as:
Like (";"(*,*)";") ....but just cant figure it out.
or go the other way and pull the @ entries:
Like ";*@*.*;" .....but that wont work for me either


Anyone got any suggestions? Thanx!

What do you mean by "pull"? Do you want an expression which will extract the
substring between the semicolons as a separate field? or do you want to search
the table for records containing "smith, patti" somwhere in the field? or
what?

If it's a search, try

LIKE "*;*" & [Enter name as lastname,firstname:] & "*;*"

to find all records where the field contains a semicolon; possibly some other
text such as a blank; the lastname,firstname exactly as entered by the user;
more spinach; another semicolon followed by anything. Of course if the user
enters "smith, patti" the record will not be found if it actually contains the
text "smith,patti".

John W. Vinson [MVP]
 
M

Michel Walsh

If you have records with an Age field and wish to know for a given age, a
parameter, what is the percentage of records having that age, or a lower
one, try:

SELECT COUNT(*) / (SELECT COUNT(*) FROM myTable)
FROM myTable
WHERE age <= [Enter age]



Note that the sub-query, (SELECT COUNT(*) FROM myTable), counts the number
of records, in the whole table, while the main COUNT(*) occurs only on
records satisfying the criteria, WHERE age <= [Enter age].



You can run a VBA function you defined yourself, as long as the function is
declared public and in a standard module (not in a class, not under a form):



SELECT MyVBAFunction( COUNT(*) / (SELECT COUNT(*) FROM myTable) )
FROM myTable
WHERE age <= [Enter age]



assuming your VBA function is defined like:


Public Function MyVBAFunction( Argument AS Double) AS double
...
' return the desired value based on the equation of the curve
' you have in mind
...
MyVBAFunction = value_to_return
End Function



Hoping it may help,
Vanderghast, Access MVP
 
S

Shamrox via AccessMonster.com

Thanx John ~ Thanks Michel.

Michel said:
If you have records with an Age field and wish to know for a given age, a
parameter, what is the percentage of records having that age, or a lower
one, try:

SELECT COUNT(*) / (SELECT COUNT(*) FROM myTable)
FROM myTable
WHERE age <= [Enter age]

Note that the sub-query, (SELECT COUNT(*) FROM myTable), counts the number
of records, in the whole table, while the main COUNT(*) occurs only on
records satisfying the criteria, WHERE age <= [Enter age].

You can run a VBA function you defined yourself, as long as the function is
declared public and in a standard module (not in a class, not under a form):

SELECT MyVBAFunction( COUNT(*) / (SELECT COUNT(*) FROM myTable) )
FROM myTable
WHERE age <= [Enter age]

assuming your VBA function is defined like:

Public Function MyVBAFunction( Argument AS Double) AS double
...
' return the desired value based on the equation of the curve
' you have in mind
...
MyVBAFunction = value_to_return
End Function

Hoping it may help,
Vanderghast, Access MVP
I have a field with
(e-mail address removed); smith,patti ; (e-mail address removed)
[quoted text clipped - 9 lines]
Anyone got any suggestions? Thanx!
 
M

Michel Walsh

Oops. Rereading my post, sounds like I was answering to someone else, from
another threat :)


Vanderghast, Access MVP
 

Ask a Question

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.

Ask a Question

Top