searching for a date

redandblack

Registered User.
Local time
Yesterday, 16:45
Joined
Feb 10, 2005
Messages
33
I have got a query for a database (this database includes tables of donators, donations, etc) and i need to write an expression for it. It needs to be a search of the exact month a donation was made. I have already played around with this expression

Like "*/02/*"


but this only brings up all donations for what ever month number was typed in. I need to have the ability to search for an exact month and then for the query to display the results of this month. The months run on a number basis i.e. 01, 02, 03, 04, 05 etc, etc.

please help!!
 
in a query you could format the date field to only display the months name, so 02 = February.

SELECT Format([DATE_FIELD],"mmmm") AS Expr1
FROM TABLE_NAME;

or

Expr1: Format([DATE_FIELD],"mmmm")


Then instead of doing a filter for Like "*/02/*", you would filter for February.

Does this help you???
 
or alternatively in the query grid put this

Code:
MonthName: Format([YourDateField],"mm")

then in the criteria put

[Enter Month Number]

Col
 
Re

i changed the format to 'long date' and then entered the code you gave me but it didnt work. am i missing something :confused: :confused: :confused:
 
ah...the second post seems to make more sense...but where do I exactly put in the first code??


MonthName: Format([YourDateField],"mm")


?????
 
redandblack said:
PLEASE HELP ME!!!! :( :eek: :( :eek:

ok don't panic :rolleyes: we do have work to do as well as helping others.


Put the code in the field name slot on the grid as if it was a field from your table. I tested it using the short date format.

You'll obviously select your date field and the other fields you need in the normal way.

Col
 
i think we are nearly there...

ive put MonthName: Format([YourDateField],"mm") into a new field title and also put [enter month number] into criteria (this is in the same column)...its still not working...i can feel that we are so very nearly there :p
 
where I have put "YourDateField" - you have to replace it with your actual date field name

Col
 
colin, you are an utter legend!!! i got it working. cheers man!!!!! :D
 

Users who are viewing this thread

Back
Top Bottom