Month Value

KarenS

Registered User.
Local time
Today, 07:41
Joined
Nov 12, 2005
Messages
31
Hi All, HAPPY NEW YEAR!

I have a 2 fields, one is start date in the format dd,mm,yyyy - the other is end date in the same format. I want to create a field in my query called "month" which will give the month for any record. This will be a parameter field.

So that when I type in January in my parameter - I will see all the records for that month. How can this be done?
 
Use the DatePart function

RV
 
But I want the actual "month" name evaluated by both the "start" and "end" date
 
Let's just focus on one of your dates. You can extrapolate it for the other.

First you need to know what month that is in, so in your query you need a field StartMonth which returns the full month you want to match. Get that to work first.

I suggest StartMonth: format(cdate([StartDate]), "mmmm")

Not sure if your date format will convert nicely using cdate. If not that is another issue.

If so your query will have a new column now with the text of the month alongside it.

Now you can add the parameter to that field, and you don't have to display it if you don't want.

You might like to enter the parameter as Like [Enter the month:] & "*" so that you can enter January or just Jan when the query runs.

Hope this helps,

Sam.
 

Users who are viewing this thread

Back
Top Bottom