473,396 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Filter by Selection on Date fields

I have a date field in a table formatted as a "Medium Date", e.g.,
29-Mar-06. When I filter by that selection it's okay when the date is
after the 13th of the month, but for the 12th or below it transposes
the month with the day, so if I filter by 1-Feb-06, I get those records
from 2-Jan-06. Anything I can do about this?

Thanks for any help.

Rachel Bourne

Mar 29 '06 #1
3 2150
See:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html

The article explains how to avoid the 3 cases where Access misunderstands
your non-American dates.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Eddie901" <ed******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
I have a date field in a table formatted as a "Medium Date", e.g.,
29-Mar-06. When I filter by that selection it's okay when the date is
after the 13th of the month, but for the 12th or below it transposes
the month with the day, so if I filter by 1-Feb-06, I get those records
from 2-Jan-06. Anything I can do about this?

Mar 29 '06 #2
Thanks for this information, Allen. Having read it, I am still confused
as to what I have to do to solve my problem, however. Or maybe I just
have to live with it...

Allen Browne wrote:
See:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html

The article explains how to avoid the 3 cases where Access misunderstands
your non-American dates.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Eddie901" <ed******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
I have a date field in a table formatted as a "Medium Date", e.g.,
29-Mar-06. When I filter by that selection it's okay when the date is
after the 13th of the month, but for the 12th or below it transposes
the month with the day, so if I filter by 1-Feb-06, I get those records
from 2-Jan-06. Anything I can do about this?


Mar 30 '06 #3
The format JET expects for a literal date in a SQL statement is mm/dd/yyyy,
delimited with #.

When you create a filter string, you need to use that format.

If you copy the SQLDate() function from the article, you can add the date to
your filter string like this:
strWhere = "[MyDateField] = " & SQLDate(Me.MyTextBox)

Or, you can use the Format() function directly if you prefer:
strWhere = "[MyDateField] = " & Format(Me.MyTextBox, "\#mm\/dd\/yyyy\#")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Eddie901" <ed******@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
Thanks for this information, Allen. Having read it, I am still confused
as to what I have to do to solve my problem, however. Or maybe I just
have to live with it...

Allen Browne wrote:
See:
International Date Formats in Access
at:
http://allenbrowne.com/ser-36.html

The article explains how to avoid the 3 cases where Access misunderstands
your non-American dates.

"Eddie901" <ed******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
>I have a date field in a table formatted as a "Medium Date", e.g.,
> 29-Mar-06. When I filter by that selection it's okay when the date is
> after the 13th of the month, but for the 12th or below it transposes
> the month with the day, so if I filter by 1-Feb-06, I get those records
> from 2-Jan-06. Anything I can do about this?

Mar 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Toby | last post by:
I've a DataAdapter with: SELECT ID, Employee, , Period_End_Date, Job, Description, Exported, Units, Cost_Code, Category, Class, Chargeout_Level, PayID, Rate FROM tblTimeEntry WHERE ...
0
by: CSDunn | last post by:
Hello, I have a problem with field filtering between an Access 2000 Project form (the application is called CELDT), and the report that shows the results of the filter. Both the form and the...
8
by: dick | last post by:
I am just trying to print/report the results of a "filter by selection" which is done by right-clicking a form, filling in values, and "applying the filter." I have searched the newsgroups, and...
3
by: Afton | last post by:
I would like to make a form that filters a report by Supervisor and by starting and ending date. I have the supervisors in a combo box, and that works. However, I do not know how to code to let...
6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching mechanism is too complicated for the occasional...
11
by: Bob | last post by:
I am in the process of upgrading an Access database to SQL Server (and climbing that learning curve!). The wizard happily upgraded all the tables and I can link to them OK using ODBC. The...
1
by: lorirobn | last post by:
Hi, I have a report that works just fine. Now I would like to add the capability to choose selection criteria to limit what is displayed. I created several reports that do this, but they used...
2
by: jcf378 | last post by:
hi all. I have a form which contains a calculated control ("days") that outputs the # of days between two dates (DateDiff command between the fields and ). However, when I click "Filter by...
9
by: dee | last post by:
I'd like to filter by the following criteria: left(LeadDisposition,3) = "Sit" AND Appt_Date = Text767 I have no idea how to do this. Appreciate help.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.