Jump to content
Macro Express Forums

Need macro variable for date


sueshe
 Share

Recommended Posts

I have a macro that opens a file using variables T1 & T2, which give me the current year and current month, ex. filename: \MyDocs\%T1%\%T2%\%T2% MTD Stats.xls, which would be for this month, \MyDocs\2008\JANUARY\January MTD Stats.xls. This works fine for every day of the month except for the first day of the next month. I need it to pull the previous month if it is the first day of the next month. So, for instance on February 1st, will need it to pull \MyDocs\2008\January\January MTD Stats.xls. Is there a way to do this? Am new to Macro Express, so not certain how this would be achieved??? Any help would be appreciated!

 

This is what I have so far:

<MACRUN2:DATE - current year YYYY>

<MACRUN2:DATE - current MONTH Mmmmm>

<LAUNCHDEL2:0:01H:\MyDocs\%T1%\%T2%\%T2% MTD Stats.xls>

Link to comment
Share on other sites

I can't see what's behind your Macro Run command but I would use the Date/Time command with an offset. I owuld first set the day of the month to T1 <DT:dT:01:1:> and if T1=1 I would generate a previous month <DT:mmmmT:02:3:{P00000}{P00001}{P00000}{P00000}>. Works slick. The whole thing looks like:

<DT:dT:01:1:><IFVAR2:1:01:1:1><DT:mmmmT:02:3:{P00000}{P00001}{P00000}{P00000}><ELSE><DT:mmmmT:02:1:><ENDIF>

Link to comment
Share on other sites

I can't see what's behind your Macro Run command but I would use the Date/Time command with an offset. I owuld first set the day of the month to T1 <DT:dT:01:1:> and if T1=1 I would generate a previous month <DT:mmmmT:02:3:{P00000}{P00001}{P00000}{P00000}>. Works slick. The whole thing looks like:
<DT:dT:01:1:><IFVAR2:1:01:1:1><DT:mmmmT:02:3:{P00000}{P00001}{P00000}{P00000}><ELSE><DT:mmmmT:02:1:><ENDIF>

 

Thanks Cory! have put in place, so I'll see in the morning, since it's the first.... if it serves the purpose!!!

 

Tasha

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

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.

Loading...
 Share

×
×
  • Create New...