Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 13th, 2004, 01:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default like clause in Access

how can use like clause in access ?

I use following query in access report, I want that when report run it ask the file_no and user
enter file_no then it display records which is like "AD" etc

I use following query in access report.
when query run and it ask file_no user enter AD930 then it display all records which related to AD930, but problem is that when user enter only AD it does not display records why ?
it should also display records which related to AD how ?
How can use * sign in the following that is display all records which is begining with AD and also AD930,AD931,AD932,..... etc.



SELECT newmail.outgoing_no, newmail.originator, newmail.actionee, newmail.letter_date, newmail.file_no, newmail.subject, newmail.filed_in, newmail.date_filed, newmail.to_from, newmail.incoming_no, newmail.sorter
FROM newmail
WHERE file_no like [#file_no#*]
ORDER BY newmail.sorter, newmail.letter_date;

Please help.

Mateen
  #2 (permalink)  
Old June 13th, 2004, 08:15 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: Lehigh Acres, FL, USA.
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

if your are using a text field you must evaluate
Place something like this in your query criteria grid
Like eval("InPutbox"(""Enter File_No:"",""newmail"")&"*"

This will prompt you with an input box " Enter file_no" if the user's input is null then query criteria will be like "like*" and will display all records.

or something like this:

LIKE "*" & [Enter Characters to Search by: ] & "*"


I hope this helps

  #3 (permalink)  
Old June 13th, 2004, 11:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: abu dbabi, , United Arab Emirates.
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for response.

LIKE "*" & [Enter Characters to Search by: ] & "*"

it is working.

Mateen





Similar Threads
Thread Thread Starter Forum Replies Last Post
error in FROM clause amrit_82 Classic ASP Professional 2 July 13th, 2004 09:14 AM
case clause in Access mateenmohd Access 19 May 6th, 2004 03:54 AM
More than 1 WHERE clause? onlyu2 MySQL 1 March 26th, 2004 01:48 PM
Like clause in Access mateenmohd Access 2 March 24th, 2004 12:46 AM
HAVING clause Adam H-W SQL Server ASP 2 February 11th, 2004 01:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.