#s to be presented as Months

S

Sue Compelling

Hi

I have a query that I want to be grouped, by month order, on my report. I
derived the month 'number' of all my records by using .......... Month:
DatePart("m",[Date]) .......... in the query and I now want the number to be
replaced by the NAME of the month in the report.

I tried this DLookUp formula

=DLookUp("[MonthName]","MonthsoftheYear","MonthID = '" & [Month] & "'")

as I have created a table with the MonthID [or #] and the MonthName, though
the control comes back with a ......... #Error

Can anyone point me in the right direction? TIA
 
O

Ofer

It's sound that the month is a number type, in that case the dlookup should
look like that
=DLookUp("[MonthName]","MonthsoftheYear","MonthID = " & [Month])
 
D

Dennis

If you still have the original date field then this will give you the month
name

=Format([DateField],"mmmm")
 
S

Sue Compelling

Brilliant - thanks 'Ofer' - that did the trick ................ I'm new to
DLookUp and merrily put ' ' all over the place ............
--
Sue Compelling


Ofer said:
It's sound that the month is a number type, in that case the dlookup should
look like that
=DLookUp("[MonthName]","MonthsoftheYear","MonthID = " & [Month])



Sue Compelling said:
Hi

I have a query that I want to be grouped, by month order, on my report. I
derived the month 'number' of all my records by using .......... Month:
DatePart("m",[Date]) .......... in the query and I now want the number to be
replaced by the NAME of the month in the report.

I tried this DLookUp formula

=DLookUp("[MonthName]","MonthsoftheYear","MonthID = '" & [Month] & "'")

as I have created a table with the MonthID [or #] and the MonthName, though
the control comes back with a ......... #Error

Can anyone point me in the right direction? TIA
 
O

Ofer

Happy to help, have a nice weekend

Sue Compelling said:
Brilliant - thanks 'Ofer' - that did the trick ................ I'm new to
DLookUp and merrily put ' ' all over the place ............
--
Sue Compelling


Ofer said:
It's sound that the month is a number type, in that case the dlookup should
look like that
=DLookUp("[MonthName]","MonthsoftheYear","MonthID = " & [Month])



Sue Compelling said:
Hi

I have a query that I want to be grouped, by month order, on my report. I
derived the month 'number' of all my records by using .......... Month:
DatePart("m",[Date]) .......... in the query and I now want the number to be
replaced by the NAME of the month in the report.

I tried this DLookUp formula

=DLookUp("[MonthName]","MonthsoftheYear","MonthID = '" & [Month] & "'")

as I have created a table with the MonthID [or #] and the MonthName, though
the control comes back with a ......... #Error

Can anyone point me in the right direction? TIA
 
O

Ofer

If you still there, then using a dlookup with date it should be a follow

=DLookUp("[MonthName]","MonthsoftheYear","Date = #" & [Date] & "#")

Sue Compelling said:
Brilliant - thanks 'Ofer' - that did the trick ................ I'm new to
DLookUp and merrily put ' ' all over the place ............
--
Sue Compelling


Ofer said:
It's sound that the month is a number type, in that case the dlookup should
look like that
=DLookUp("[MonthName]","MonthsoftheYear","MonthID = " & [Month])



Sue Compelling said:
Hi

I have a query that I want to be grouped, by month order, on my report. I
derived the month 'number' of all my records by using .......... Month:
DatePart("m",[Date]) .......... in the query and I now want the number to be
replaced by the NAME of the month in the report.

I tried this DLookUp formula

=DLookUp("[MonthName]","MonthsoftheYear","MonthID = '" & [Month] & "'")

as I have created a table with the MonthID [or #] and the MonthName, though
the control comes back with a ......... #Error

Can anyone point me in the right direction? TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top