Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Between Dates and Like
Bill Swan 
    
2 years ago
Hi
A query for a report gets its data and
This " Like " works great if nothing is entered in the field.

Like [Forms]![MyForm]![Employee] & "*"

All employees are listed if the Employee field (combobox) is left blank. Of course if an employee is chosen then only that employee appears.

The date between 2 fields works fine if dates are entered

>=[Forms]![MyForm]![Fromdate] And <=[Forms]![MyForm]![ToDate]

However if dates are not entered I would like all dates to appear but cant seem to use " Like " anywhere.

Suggestions appreciated or an alternative?

p.s not sure if start a new thread for this issue but found if dates entered say 1st september to 20th september and there is no entry for 1st september ( say first date is 2nd September ) then nothing appears. If put 2nd September to 20th september then report is generated.
Sami Shamma  @Reply  
             
2 years ago
You need another "*"
Like "*" & [Forms]![MyForm]![Employee] & "*"
Kevin Yip  @Reply  
     
2 years ago
When the dates are null, use the IIf() and Nz() functions to convert them to the earliest and latest possible dates that can be used in Access (which are Jan 1st, 100 AD and Dec 31st, 9999 AD).  That should return all records.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 5:17:56 AM. PLT: 1s