Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MonthName in Query column. 1

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
Instead of Date() I would like to put the current month in a column in my query but cant find the right code. I tried Month(now()) which gives me the number 7 and I've tried to alter this "MonthName(month[, abbreviate])" but can get it to work. Can anyone help.
 
Format(Date, 'mmmm')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
sorry for the typo:
Format(Date(), 'mmmm')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi again PH,
I didn't mentioned that I wanted to append the query into a table could you tell me what data type or format to make the field so that it recognises it as a month. It wont append into a date/time field only a text field.
 
Don't confuse data storage and data presentation.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi again,
Yes I get your point. I will store it as a date() and I have a table with months in it I will use that in my queries.
Thanks for the help and advise.
 
I have a table with months
Why ?
I showed you how it is easy to retrieve month from date in a query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,
What I was hoping to achieve here is, import an excel file into my temp table "assimilation", then append with a date stamp (in VBA) into "tblassimilation". Since the file only comes once a month I thought that I could just put in the month. I did try to use your code to show Date() as July but with no success so since the Month table is already there. :)
 
Hi,

Gone back to plan A:

Format(Date(), 'mmmm-yy')

in the query and in the format of the field:

mmmm-yy

given me july-06 in the field.

Thanks again PHV.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top