Another way to get last month is to take the first of the current month and subtract 1 day.  (This also works to calculate the last day of last month.)

<@days date=<@currentDate format=”datetime:%m/1/%Y”> days=-1 format=”datetime:%b”>

 

Dave.

 

-----Original Message-----
From: Steve Smith [mailto:[EMAIL PROTECTED]
Sent: December 16, 2003 6:58 AM
To: [EMAIL PROTECTED]
Subject: Re: Witango-Talk: Formating Variables

 

I've got the logic to handle January, it was the /1/year that I was forgetting. It was the end of a long day and it is now the beginning of another long day but the brain has had some sleep so this makes sense.

Thanks for your help,

Steve Smith

Oakbridge Information Solutions
Office: (519) 624-4388
GTA: (416) 606-3885
Fax: (519) 624-3353
Cell: (416) 606-3885
Email: [EMAIL PROTECTED]
Web: http://www.oakbridge.ca

On Monday, December 15, 2003, at 10:44 PM, Customer Support wrote:

Steve,
Try:

<@ASSIGN request$r_month VALUE='<@CALC EXPR="<@CURRENTDATE FORMAT='datetime:%m'> - 1">/1/2003'>
<@VAR REQUEST$r_month FORMAT='datetime:%b'>

It is a little primitive if you are trying to find "Last Month" as it will not find Dec if you are in Jan. Make sure you format the date in the default date format for your server.

Witango Support


On 16/12/2003, at 2:25 PM, Steve Smith wrote:

I'm sure that I've used the FORMAT attribute on variables before with success. I'm using the following lines of code on Witango Mac OS X build 062:

<@ASSIGN NAME="r_month" VALUE='<@CALC EXPR="<@CURRENTDATE FORMAT='datetime:%m'> - 1">' SCOPE="REQUEST">
<@VAR NAME='REQUEST$r_month' FORMAT='datetime:%b'>

and I'm expecting to see 'Nov.' as the result. Instead I see '11'. Am I:

a) trying to do the impossible
b) seeing a bug
c) using code with a typo in it
d) just overtired

Please let me know.

Thanks,

Steve Smith

Oakbridge Information Solutions
Office: (519) 624-4388
GTA: (416) 606-3885
Fax: (519) 624-3353
Cell: (416) 606-3885
Email: [EMAIL PROTECTED]
Web: http://www.oakbridge.ca

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to