Month Names

A

Al

Hi, hope someone can help

I need to set up a table with 12 records - one for each month name.

When I display the data I need to sort it so that the current month is at
the top with the following 11 fields going back in Chronological order - eg
currently it would be:

March
February
January
etc

On 1st April I want it to show:
April
March
February
etc etc

Is this possible please and if so, how can it be done. Can add another
field to table if necessary

Thanks

Alex
 
C

Cheryl Fischer

Yes, add a MonthNumber field to your table and insert the month number
appropriate to the MonthName. In a query, you can sort by the MonthNumber
in descending order.
 
G

Gerald Stanley

The following solution reuires a column monthId on the
table where monthNo = 1 for January , 2 for February etc

SELECT {yourMonthName}
FROM {yourTableName}
ORDER BY
IIf(Month(Now())>=[monthId],[monthId],[monthId]-12) DESC;

Hope This Helps
Gerald Stanley MCSD
 

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