Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 7th, 2006, 07:41 AM
Authorized User
 
Join Date: Jun 2003
Location: Essendon, Victoria, Australia.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default Filter form with date fields problem!!

has anybody got an idea how i could filter Access forms using date fields. Don't get me wrong... I know how to use filter but everytime i use it on date fields in Access it returns wrong dates or sometimes doesn't return anything at all.

  I have played with it soo much till now i feel am jus guessing solutions rather than know the solutions. I can't even explain why i don't get data at times and not at other times.

If you have experienced such problems please help!!.


LION OF JUDDAH!
__________________
LION OF JUDDAH!
Reply With Quote
  #2 (permalink)  
Old August 10th, 2006, 12:34 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Please post some data from the date fields. Access can get freaky when the dates take formats like YYYY-MM-DD, etc. SO if you date fields are not what Access is expecting, it won't return any records, or the wrong records.

One solution I use is to use a combo box to look up the dates as they are formatted, and then use them as strings to get the data filtered.

HTH

mmcdonal
Reply With Quote
  #3 (permalink)  
Old August 14th, 2006, 10:15 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

If you're talking about filtering the date fields via VBA programming just remember to delimit the date variable with pound signs. For example:

Me.Filter = "[dtmDueDate] < #" & Date() & "#"

Also remember not to name any fields in your tables just DATE because that is a reserved Access function that returns today's date.

The function Now() returns the date and current time, so only use that one if time of day matters. If not, comparing a date to Now will rarely match because a date is usually stored with midnight as the time if Now was not used in the first place.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter dataset by Date? spacky001 ASP.NET 2.0 Basics 1 January 23rd, 2007 07:17 PM
comparing date/time fields on form validation Lucy Javascript How-To 1 June 20th, 2006 09:22 AM
How can i filter d repot fields at runtime... nikks9 Crystal Reports 1 June 9th, 2006 05:41 AM
problem with filter form keyvan Classic ASP Databases 1 June 29th, 2003 05:17 AM



All times are GMT -4. The time now is 10:43 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.