Jump to content

month as a number


This topic is 8422 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm not sure if this will answer your question but.....

Create a calculation field as follows:

Case(

Month=Jan (or January),"1",

Month=Feb (or February),"2",

Month=Mar (or March),"3",........

Month=Dec (or December),"12","")

If your field contains the entire date, ie: Jan 1, 2001, you have two options.

1. Create a Month field that is a calculation:

Month=left(date,3)

2. In your Case statement above substitute left(date,3) for Month.

[ June 27, 2001: Message edited by: esteshk ]

Link to comment
Share on other sites

sorry....I should have been more specific... I needed an applescript solution. When you ask for the current date, you only get the month as text, I was just wondering if there's a way to call the current date and get the month as an integer.

Link to comment
Share on other sites

If you need to do this in AppleScript (and I have before needed to do just that) the most compact way I know of with this code:

code:


set rightNow to current date

set possibleMonths to {January, February, March, April, May, June} &
Link to comment
Share on other sites

This topic is 8422 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.