View Full Version : Convert Month Name to Number


spcepickle
04-09-2008, 09:55 AM
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!

raskew
04-09-2008, 04:37 PM
Hi -

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


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