dbTalk Databases Forums  

Query help needed

comp.databases.ms-access comp.databases.ms-access


Discuss Query help needed in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ty
 
Posts: n/a

Default Query help needed - 02-10-2011 , 03:09 PM






I'm using a query from training exercise on the internet. Read down
below:

http://www.ms-access2010.com/tutorials/queries.html

SELECT Customers.[First Name], Customers.[Last Name], Customers.[Home
Phone], Customers.[E-mail Address], Customers.Sex
FROM Customers
WHERE (((Customers.Sex)='F'))
ORDER BY Customers.[Last Name];

Now,.. I have my own created database from Excel spreadsheets. The
database has a comments column that has words, sentences and
comments...etc.

My problem/Question: Is it possible to just do the same query for the
comments column(field) but only look for a word like 'tyrone_bak'.

My problem: No rows are displaying with the words 'tyrone_bak'. Just
the * and the Comments column with no data. Record 1 of 1 in the
bottom left corner.

The comments field might have "Tyrone_bak belongs to the executive
committee" or "Tyrone_bak is still learning about databases".

Thanks a million,
Ty

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Query help needed - 02-10-2011 , 03:48 PM






Ty wrote:

Quote:
I'm using a query from training exercise on the internet. Read down
below:

http://www.ms-access2010.com/tutorials/queries.html

SELECT Customers.[First Name], Customers.[Last Name], Customers.[Home
Phone], Customers.[E-mail Address], Customers.Sex
FROM Customers
WHERE (((Customers.Sex)='F'))
ORDER BY Customers.[Last Name];

Now,.. I have my own created database from Excel spreadsheets. The
database has a comments column that has words, sentences and
comments...etc.

My problem/Question: Is it possible to just do the same query for the
comments column(field) but only look for a word like 'tyrone_bak'.

My problem: No rows are displaying with the words 'tyrone_bak'. Just
the * and the Comments column with no data. Record 1 of 1 in the
bottom left corner.

The comments field might have "Tyrone_bak belongs to the executive
committee" or "Tyrone_bak is still learning about databases".

Thanks a million,
Ty
I'll assume the comments field is a memo. You could create another
column in your query. Let's say the field to search is called Comments,
the table Customers. In the new column enter
HasString : Instr([Comments,"Tyrone_bak")
and in the criteria/search row enter
Quote:
0
Now when you run the query it will return the records.

If you want to make it flexible you could change the HasString column to
Expr1: InStr([Comments],[Enter Search Value])
This will prompt you to enter a search string value.

You can uncheck the Show checkbox if you don't want to display the
number where the occurrence was found.

Reply With Quote
  #3  
Old   
Bob Quintal
 
Posts: n/a

Default Re: Query help needed - 02-10-2011 , 03:54 PM



Ty <tyrone_bak (AT) yahoo (DOT) com> wrote in
news:b8056f5a-2d90-464a-a4f0-711b925f9e48 (AT) x11g2000yqc (DOT) googlegroups.co
m:

Quote:
I'm using a query from training exercise on the internet. Read
down below:

http://www.ms-access2010.com/tutorials/queries.html

SELECT Customers.[First Name], Customers.[Last Name],
Customers.[Home Phone], Customers.[E-mail Address], Customers.Sex
FROM Customers
WHERE (((Customers.Sex)='F'))
ORDER BY Customers.[Last Name];

Now,.. I have my own created database from Excel spreadsheets.
The database has a comments column that has words, sentences and
comments...etc.

My problem/Question: Is it possible to just do the same query for
the comments column(field) but only look for a word like
'tyrone_bak'.

My problem: No rows are displaying with the words 'tyrone_bak'.
Just the * and the Comments column with no data. Record 1 of 1 in
the bottom left corner.

The comments field might have "Tyrone_bak belongs to the executive
committee" or "Tyrone_bak is still learning about databases".

Thanks a million,
Ty

You need to research the help for 'wildcard'
Basically, if you want to find a string of characters that are
contained anywhere in the field you put an asterisk before and after
your search key.e.g. WHERE Customers.Comments like '*tyrone_bak*'



--
Bob Q.
PA is y I've altered my address.

Reply With Quote
  #4  
Old   
Ty
 
Posts: n/a

Default Re: Query help needed - 02-10-2011 , 04:13 PM



On Feb 10, 3:54*pm, Bob Quintal <rquin... (AT) sPAmpatico (DOT) ca> wrote:
Quote:
Ty <tyrone_... (AT) yahoo (DOT) com> wrote innews:b8056f5a-2d90-464a-a4f0-711b925f9e48 (AT) x11g2000yqc (DOT) googlegroups.co
m:





I'm using a query from training exercise on the internet. *Read
down below:

http://www.ms-access2010.com/tutorials/queries.html

SELECT Customers.[First Name], Customers.[Last Name],
Customers.[Home Phone], Customers.[E-mail Address], Customers.Sex
FROM Customers
WHERE (((Customers.Sex)='F'))
ORDER BY Customers.[Last Name];

Now,.. I have my own created database from Excel spreadsheets.
The database has a comments column that has words, sentences and
comments...etc.

My problem/Question: *Is it possible to just do the same query for
the comments column(field) but only look for a word like
'tyrone_bak'.

My problem: No rows are displaying with the words 'tyrone_bak'.
Just the * and the Comments column with no data. *Record 1 of 1 in
the bottom left corner.

The comments field might have "Tyrone_bak belongs to the executive
committee" or "Tyrone_bak is still learning about databases".

Thanks a million,
Ty

You need to research the help for 'wildcard'
Basically, if you want to find a string of characters that are
contained anywhere in the field you put an asterisk before and after
your search key.e.g. WHERE Customers.Comments like '*tyrone_bak*'

--
Bob Q.
PA is y I've altered my address.- Hide quoted text -

- Show quoted text -
Thank you!!! This is answer is better. The answer above is
complicated for me at this time. I'm able to view all rows that have
the text with '*tyrone_bak*'.

Reply With Quote
  #5  
Old   
Ty
 
Posts: n/a

Default Re: Query help needed - 02-10-2011 , 04:28 PM



On Feb 10, 4:13*pm, Ty <tyrone_... (AT) yahoo (DOT) com> wrote:
Quote:
On Feb 10, 3:54*pm, Bob Quintal <rquin... (AT) sPAmpatico (DOT) ca> wrote:





Ty <tyrone_... (AT) yahoo (DOT) com> wrote innews:b8056f5a-2d90-464a-a4f0-711b925f9e48 (AT) x11g2000yqc (DOT) googlegroups.co
m:

I'm using a query from training exercise on the internet. *Read
down below:

http://www.ms-access2010.com/tutorials/queries.html

SELECT Customers.[First Name], Customers.[Last Name],
Customers.[Home Phone], Customers.[E-mail Address], Customers.Sex
FROM Customers
WHERE (((Customers.Sex)='F'))
ORDER BY Customers.[Last Name];

Now,.. I have my own created database from Excel spreadsheets.
The database has a comments column that has words, sentences and
comments...etc.

My problem/Question: *Is it possible to just do the same query for
the comments column(field) but only look for a word like
'tyrone_bak'.

My problem: No rows are displaying with the words 'tyrone_bak'.
Just the * and the Comments column with no data. *Record 1 of 1 in
the bottom left corner.

The comments field might have "Tyrone_bak belongs to the executive
committee" or "Tyrone_bak is still learning about databases".

Thanks a million,
Ty

You need to research the help for 'wildcard'
Basically, if you want to find a string of characters that are
contained anywhere in the field you put an asterisk before and after
your search key.e.g. WHERE Customers.Comments like '*tyrone_bak*'

--
Bob Q.
PA is y I've altered my address.- Hide quoted text -

- Show quoted text -

Thank you!!! *This is answer is better. *The answer above is
complicated for me at this time. *I'm able to view all rows that have
the text with '*tyrone_bak*'.- Hide quoted text -

- Show quoted text -
More information. After I added the *. MS Access added the
following: Like '*tyrone_bak*'

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.