Convert Month Name to Number

spcepickle

Registered User.
Local time
Today, 13:01
Joined
Jan 8, 2008
Messages
30
Hi All - I would like the user to be able to import a month name (April for example) and then have access convert that name to a number (4) so that I can search for records that were opened before the month entered. I have been using:

MonthName(Month([CompletionDate])) = [Enter Month]

but

MonthName(Month([CompletionDate])) <= [Enter Month]

does not work.

Thanks!
 
Hi -

See if the use of the Instr() function helps. Note: Written in A97, so MonthName() is not an option.

Code:
x="janfebmaraprmayjunjulaugsepoctnovdec"
y = "jul"
? int(instr(x,y)/3)+1
 7 

--or--

x = "january  Febuary  March    April    May      June     July     August   SeptemberOctober  November December"
y = "September"
? int(instr(x,y)/9)+ 1
 9

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom