Jump to content
Sign in to follow this  
pug

month as a number

Recommended Posts

how do i pull the month of the current date and get it as a number instead of text? is it possible?

Share this post


Link to post
Share on other sites

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 ]

Share this post


Link to post
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.

Share this post


Link to post
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} &

Share this post


Link to post
Share on other sites

yeah....I just finished writing that script..... but why would Applescript not let you call the month as an integer in the first place....what a thing to miss.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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