Re: Long Date Search - JCW



John - this worked great. Thanks for your help.
--
JCW


"John W. Vinson" wrote:

On Sat, 19 Sep 2009 14:35:01 -0700, JohnW <JohnW@xxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:

I have a field called birthdate that I have formatted for long date so when
the user inputs the date as 8/21/1999 the month name August will appear in
the field also. I want to be able to serach for all birthdays in a month but
when I set the search criteria in my query to search for a name of a month it
does not find anything. It will find numbers from this field but not text.
How can I do this?

Thanks for the help.

Regardless of the format, a Date/Time field is actually stored as a Double
Float number, a count of days and fractions of a day (times) since midnight,
December 30, 1899. The Format just controls how it's displayed - the date does
NOT contain the text string "August" at all.

To get all birthdates that fall in August (of any month, August 1921 or August
2004) use a Query with a calculated field; you could type

BirthMonth: Format([birthdate], "mmmm")

This wiill give a text string, "August" or "May" or whatever, and can be used
for search criteria.
--

John W. Vinson [MVP]

.



Relevant Pages

  • Re: Query Help Needed
    ... John W. Vinson wrote: ... The format is irrelevant - it does not affect what's stored, ... for that month using a self join query like: ...
    (microsoft.public.access.queries)
  • Re: copy records next in order
    ... "John W. Vinson" wrote: ... Number field with the prefix introduced by the format setting? ... for there initials and it will add those records to the table. ...
    (microsoft.public.access.queries)
  • Re: calculation problem
    ... "John W. Vinson" wrote: ... Do you have any of these fields defined with a Percent format? ... You may want to try deleteing the control from the form; compact the database; ...
    (microsoft.public.access.modulesdaovba)
  • Re: Yes/No field appears as -1/0
    ... "John W. Vinson" wrote: ... I have a Yes/No field but in all queries and reports it appears with the ... set the Format property of the textbox bound to the yes/no field ...
    (microsoft.public.access.gettingstarted)
  • Re: calculation problem
    ... "John W. Vinson" wrote: ... Do you have any of these fields defined with a Percent format? ... Doublecheck the Format property of the *textbox* on the form. ...
    (microsoft.public.access.modulesdaovba)