Re: Date Calculation issue

2014-09-02 Thread Karthick S
Hi Misi,

Thanks for the mail, issue got fixed. in Server Language setting was US
format and after changing that to Australia and reboot the Remedy server.
it worked just fine.
once again thanks for the date calculation.


On Tue, Sep 2, 2014 at 2:59 PM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 Is your target field a char-field?

 Try splitting things up to find where it goes wrong:

 tmpint1 = $DATE$
 tmpint2 = DATEADD(day, 1-DAY($tmpint1$), $tmpint1$)
 tmpdate = DATEADD(month, 1, $tmpint2$) - 1

 Best Regards - Misi, RRR AB, http://rrr.se

  Hi Misi,
 
  Your calculation works fine in our Dev environment, but when i use the
 same
  date calculation in production system it gives this date '01/01/1970
  11:00:31 AM'.
 
 
  On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:
 
  Hi,
 
  Could you please describe what you want to accomplish?
 
  If you want to get the last second of the current month, I would do
  somethinglike:
 
  DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1
 
  And in two steps:
 
  Get the first second of the current month:
  firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)
 
  Get the last second based on the first second of the month
  lastsecond = DATEADD(month, 1, $firstsecond$) - 1
 
  Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP
 2011)
 
  Ask the Remedy Licensing Experts (Best R.O.I. Award at
 WWRUG10/11/12/13):
  * RRR|License - Not enough Remedy licenses? Save money by optimizing.
  * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy
 logs.
  Find these products, and many free tools and utilities, at
 http://rrr.se.
 
   Hi All,
  
   Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase
 - MS
   SQL 2005.
  
  
   *In Dev System:*
   I used the below date function in one of the workflow, which worked
 fine
   and the result were as expected. I got the date is '30/09/2014
 11:59:59
  PM'.
  
   DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
   DATEADD( month, 1, $DATE$)) + (86400 - 1)
  
  
   *In Production:*
   When i used the same Date function in Production system, it give the
 Date
   '02/01/1970 11:00:30 AM'
  
   The issue looks very strange and i am unable to figure it out, please
  help
   me on this.
  
   *Thanks and Regards,*
   *Karthick S*
  
  
 
 ___
   UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
   Where the Answers Are, and have been for 20 years
  
 
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 
 
 
 
  --
 
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




-- 


*Thanks and Regards,*
*Karthick S*

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-02 Thread Misi Mladoniczky
Hi,

I guessed as much, but a calculation should be made to work in any
environment. With the exception of a different timezone setting in this case.

Your underlying problem still seems to be a char-conversion of your timestamp,
and it would be nice to know the root cause.

What datatype did your field have?

Best Regards - Misi, RRR AB, http://rrr.se

 Hi Misi,

 Thanks for the mail, issue got fixed. in Server Language setting was US
 format and after changing that to Australia and reboot the Remedy server.
 it worked just fine.
 once again thanks for the date calculation.


 On Tue, Sep 2, 2014 at 2:59 PM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 Is your target field a char-field?

 Try splitting things up to find where it goes wrong:

 tmpint1 = $DATE$
 tmpint2 = DATEADD(day, 1-DAY($tmpint1$), $tmpint1$)
 tmpdate = DATEADD(month, 1, $tmpint2$) - 1

 Best Regards - Misi, RRR AB, http://rrr.se

  Hi Misi,
 
  Your calculation works fine in our Dev environment, but when i use the
 same
  date calculation in production system it gives this date '01/01/1970
  11:00:31 AM'.
 
 
  On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:
 
  Hi,
 
  Could you please describe what you want to accomplish?
 
  If you want to get the last second of the current month, I would do
  somethinglike:
 
  DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1
 
  And in two steps:
 
  Get the first second of the current month:
  firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)
 
  Get the last second based on the first second of the month
  lastsecond = DATEADD(month, 1, $firstsecond$) - 1
 
  Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP
 2011)
 
  Ask the Remedy Licensing Experts (Best R.O.I. Award at
 WWRUG10/11/12/13):
  * RRR|License - Not enough Remedy licenses? Save money by optimizing.
  * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy
 logs.
  Find these products, and many free tools and utilities, at
 http://rrr.se.
 
   Hi All,
  
   Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase
 - MS
   SQL 2005.
  
  
   *In Dev System:*
   I used the below date function in one of the workflow, which worked
 fine
   and the result were as expected. I got the date is '30/09/2014
 11:59:59
  PM'.
  
   DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
   DATEADD( month, 1, $DATE$)) + (86400 - 1)
  
  
   *In Production:*
   When i used the same Date function in Production system, it give the
 Date
   '02/01/1970 11:00:30 AM'
  
   The issue looks very strange and i am unable to figure it out, please
  help
   me on this.
  
   *Thanks and Regards,*
   *Karthick S*
  
  
 
 ___
   UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
   Where the Answers Are, and have been for 20 years
  
 
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 
 
 
 
  --
 
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




 --


 *Thanks and Regards,*
 *Karthick S*

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-02 Thread Omega LiPO
I guess, the us time is mm/dd/yy, and aus time zone is dd/mm/yy. Invalid time 
goes to the b-day, that what I am guessing. 

// OmegaLi

-Original Message-
From: Misi Mladoniczky m...@rrr.se
Sent: ‎2/‎9/‎2014 15:17
To: arslist@ARSLIST.ORG arslist@ARSLIST.ORG
Subject: Re: Date Calculation issue

Hi,

I guessed as much, but a calculation should be made to work in any
environment. With the exception of a different timezone setting in this case.

Your underlying problem still seems to be a char-conversion of your timestamp,
and it would be nice to know the root cause.

What datatype did your field have?

Best Regards - Misi, RRR AB, http://rrr.se

 Hi Misi,

 Thanks for the mail, issue got fixed. in Server Language setting was US
 format and after changing that to Australia and reboot the Remedy server.
 it worked just fine.
 once again thanks for the date calculation.


 On Tue, Sep 2, 2014 at 2:59 PM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 Is your target field a char-field?

 Try splitting things up to find where it goes wrong:

 tmpint1 = $DATE$
 tmpint2 = DATEADD(day, 1-DAY($tmpint1$), $tmpint1$)
 tmpdate = DATEADD(month, 1, $tmpint2$) - 1

 Best Regards - Misi, RRR AB, http://rrr.se

  Hi Misi,
 
  Your calculation works fine in our Dev environment, but when i use the
 same
  date calculation in production system it gives this date '01/01/1970
  11:00:31 AM'.
 
 
  On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:
 
  Hi,
 
  Could you please describe what you want to accomplish?
 
  If you want to get the last second of the current month, I would do
  somethinglike:
 
  DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1
 
  And in two steps:
 
  Get the first second of the current month:
  firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)
 
  Get the last second based on the first second of the month
  lastsecond = DATEADD(month, 1, $firstsecond$) - 1
 
  Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP
 2011)
 
  Ask the Remedy Licensing Experts (Best R.O.I. Award at
 WWRUG10/11/12/13):
  * RRR|License - Not enough Remedy licenses? Save money by optimizing.
  * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy
 logs.
  Find these products, and many free tools and utilities, at
 http://rrr.se.
 
   Hi All,
  
   Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase
 - MS
   SQL 2005.
  
  
   *In Dev System:*
   I used the below date function in one of the workflow, which worked
 fine
   and the result were as expected. I got the date is '30/09/2014
 11:59:59
  PM'.
  
   DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
   DATEADD( month, 1, $DATE$)) + (86400 - 1)
  
  
   *In Production:*
   When i used the same Date function in Production system, it give the
 Date
   '02/01/1970 11:00:30 AM'
  
   The issue looks very strange and i am unable to figure it out, please
  help
   me on this.
  
   *Thanks and Regards,*
   *Karthick S*
  
  
 
 ___
   UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
   Where the Answers Are, and have been for 20 years
  
 
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 
 
 
 
  --
 
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




 --


 *Thanks and Regards,*
 *Karthick S*

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-02 Thread Misi Mladoniczky
Hi,

Probably true, but there should be no such issue unless there is a conversion
to a character-field somewhere. If you do it in one go into a date/time-field
there should be no issue.

Best Regards - Misi, RRR AB, http://rrr.se

 I guess, the us time is mm/dd/yy, and aus time zone is dd/mm/yy. Invalid time
 goes to the b-day, that what I am guessing.

 // OmegaLi

 -Original Message-
 From: Misi Mladoniczky m...@rrr.se
 Sent: ‎2/‎9/‎2014 15:17
 To: arslist@ARSLIST.ORG arslist@ARSLIST.ORG
 Subject: Re: Date Calculation issue

 Hi,

 I guessed as much, but a calculation should be made to work in any
 environment. With the exception of a different timezone setting in this case.

 Your underlying problem still seems to be a char-conversion of your timestamp,
 and it would be nice to know the root cause.

 What datatype did your field have?

 Best Regards - Misi, RRR AB, http://rrr.se

 Hi Misi,

 Thanks for the mail, issue got fixed. in Server Language setting was US
 format and after changing that to Australia and reboot the Remedy server.
 it worked just fine.
 once again thanks for the date calculation.


 On Tue, Sep 2, 2014 at 2:59 PM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 Is your target field a char-field?

 Try splitting things up to find where it goes wrong:

 tmpint1 = $DATE$
 tmpint2 = DATEADD(day, 1-DAY($tmpint1$), $tmpint1$)
 tmpdate = DATEADD(month, 1, $tmpint2$) - 1

 Best Regards - Misi, RRR AB, http://rrr.se

  Hi Misi,
 
  Your calculation works fine in our Dev environment, but when i use the
 same
  date calculation in production system it gives this date '01/01/1970
  11:00:31 AM'.
 
 
  On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:
 
  Hi,
 
  Could you please describe what you want to accomplish?
 
  If you want to get the last second of the current month, I would do
  somethinglike:
 
  DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1
 
  And in two steps:
 
  Get the first second of the current month:
  firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)
 
  Get the last second based on the first second of the month
  lastsecond = DATEADD(month, 1, $firstsecond$) - 1
 
  Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP
 2011)
 
  Ask the Remedy Licensing Experts (Best R.O.I. Award at
 WWRUG10/11/12/13):
  * RRR|License - Not enough Remedy licenses? Save money by optimizing.
  * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy
 logs.
  Find these products, and many free tools and utilities, at
 http://rrr.se.
 
   Hi All,
  
   Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase
 - MS
   SQL 2005.
  
  
   *In Dev System:*
   I used the below date function in one of the workflow, which worked
 fine
   and the result were as expected. I got the date is '30/09/2014
 11:59:59
  PM'.
  
   DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
   DATEADD( month, 1, $DATE$)) + (86400 - 1)
  
  
   *In Production:*
   When i used the same Date function in Production system, it give the
 Date
   '02/01/1970 11:00:30 AM'
  
   The issue looks very strange and i am unable to figure it out, please
  help
   me on this.
  
   *Thanks and Regards,*
   *Karthick S*
  
  
 
 ___
   UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
   Where the Answers Are, and have been for 20 years
  
 
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 
 
 
 
  --
 
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




 --


 *Thanks and Regards,*
 *Karthick S*

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-02 Thread Karthick S
Date/Time field.


On Tue, Sep 2, 2014 at 5:16 PM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 I guessed as much, but a calculation should be made to work in any
 environment. With the exception of a different timezone setting in this
 case.

 Your underlying problem still seems to be a char-conversion of your
 timestamp,
 and it would be nice to know the root cause.

 What datatype did your field have?

 Best Regards - Misi, RRR AB, http://rrr.se

  Hi Misi,
 
  Thanks for the mail, issue got fixed. in Server Language setting was US
  format and after changing that to Australia and reboot the Remedy server.
  it worked just fine.
  once again thanks for the date calculation.
 
 
  On Tue, Sep 2, 2014 at 2:59 PM, Misi Mladoniczky m...@rrr.se wrote:
 
  Hi,
 
  Is your target field a char-field?
 
  Try splitting things up to find where it goes wrong:
 
  tmpint1 = $DATE$
  tmpint2 = DATEADD(day, 1-DAY($tmpint1$), $tmpint1$)
  tmpdate = DATEADD(month, 1, $tmpint2$) - 1
 
  Best Regards - Misi, RRR AB, http://rrr.se
 
   Hi Misi,
  
   Your calculation works fine in our Dev environment, but when i use the
  same
   date calculation in production system it gives this date '01/01/1970
   11:00:31 AM'.
  
  
   On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:
  
   Hi,
  
   Could you please describe what you want to accomplish?
  
   If you want to get the last second of the current month, I would do
   somethinglike:
  
   DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1
  
   And in two steps:
  
   Get the first second of the current month:
   firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)
  
   Get the last second based on the first second of the month
   lastsecond = DATEADD(month, 1, $firstsecond$) - 1
  
   Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP
  2011)
  
   Ask the Remedy Licensing Experts (Best R.O.I. Award at
  WWRUG10/11/12/13):
   * RRR|License - Not enough Remedy licenses? Save money by optimizing.
   * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy
  logs.
   Find these products, and many free tools and utilities, at
  http://rrr.se.
  
Hi All,
   
Our remedy version is 7.1, Server - Windows 2003 R2 Server,
 Datebase
  - MS
SQL 2005.
   
   
*In Dev System:*
I used the below date function in one of the workflow, which worked
  fine
and the result were as expected. I got the date is '30/09/2014
  11:59:59
   PM'.
   
DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
DATEADD( month, 1, $DATE$)) + (86400 - 1)
   
   
*In Production:*
When i used the same Date function in Production system, it give
 the
  Date
'02/01/1970 11:00:30 AM'
   
The issue looks very strange and i am unable to figure it out,
 please
   help
me on this.
   
*Thanks and Regards,*
*Karthick S*
   
   
  
 
 ___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years
   
  
  
  
 
 ___
   UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
   Where the Answers Are, and have been for 20 years
  
  
  
  
   --
  
  
   *Thanks and Regards,*
   *Karthick S*
  
  
 
 ___
   UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
   Where the Answers Are, and have been for 20 years
  
 
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 
 
 
 
  --
 
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




-- 


*Thanks and Regards,*
*Karthick S*

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Date Calculation issue

2014-09-01 Thread Karthick S
Hi All,

Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase - MS
SQL 2005.


*In Dev System:*
I used the below date function in one of the workflow, which worked fine
and the result were as expected. I got the date is '30/09/2014 11:59:59 PM'.

DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
DATEADD( month, 1, $DATE$)) + (86400 - 1)


*In Production:*
When i used the same Date function in Production system, it give the Date
'02/01/1970 11:00:30 AM'

The issue looks very strange and i am unable to figure it out, please help
me on this.

*Thanks and Regards,*
*Karthick S*

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-01 Thread Misi Mladoniczky
Hi,

Could you please describe what you want to accomplish?

If you want to get the last second of the current month, I would do
somethinglike:

DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1

And in two steps:

Get the first second of the current month:
firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)

Get the last second based on the first second of the month
lastsecond = DATEADD(month, 1, $firstsecond$) - 1

Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP 2011)

Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13):
* RRR|License - Not enough Remedy licenses? Save money by optimizing.
* RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs.
Find these products, and many free tools and utilities, at http://rrr.se.

 Hi All,

 Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase - MS
 SQL 2005.


 *In Dev System:*
 I used the below date function in one of the workflow, which worked fine
 and the result were as expected. I got the date is '30/09/2014 11:59:59 PM'.

 DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
 DATEADD( month, 1, $DATE$)) + (86400 - 1)


 *In Production:*
 When i used the same Date function in Production system, it give the Date
 '02/01/1970 11:00:30 AM'

 The issue looks very strange and i am unable to figure it out, please help
 me on this.

 *Thanks and Regards,*
 *Karthick S*

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-01 Thread Karthick S
Hi Misi,

Your calculation works fine in our Dev environment, but when i use the same
date calculation in production system it gives this date '01/01/1970
11:00:31 AM'.


On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 Could you please describe what you want to accomplish?

 If you want to get the last second of the current month, I would do
 somethinglike:

 DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1

 And in two steps:

 Get the first second of the current month:
 firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)

 Get the last second based on the first second of the month
 lastsecond = DATEADD(month, 1, $firstsecond$) - 1

 Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP 2011)

 Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13):
 * RRR|License - Not enough Remedy licenses? Save money by optimizing.
 * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs.
 Find these products, and many free tools and utilities, at http://rrr.se.

  Hi All,
 
  Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase - MS
  SQL 2005.
 
 
  *In Dev System:*
  I used the below date function in one of the workflow, which worked fine
  and the result were as expected. I got the date is '30/09/2014 11:59:59
 PM'.
 
  DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
  DATEADD( month, 1, $DATE$)) + (86400 - 1)
 
 
  *In Production:*
  When i used the same Date function in Production system, it give the Date
  '02/01/1970 11:00:30 AM'
 
  The issue looks very strange and i am unable to figure it out, please
 help
  me on this.
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




-- 


*Thanks and Regards,*
*Karthick S*

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Date Calculation issue

2014-09-01 Thread Misi Mladoniczky
Hi,

Is your target field a char-field?

Try splitting things up to find where it goes wrong:

tmpint1 = $DATE$
tmpint2 = DATEADD(day, 1-DAY($tmpint1$), $tmpint1$)
tmpdate = DATEADD(month, 1, $tmpint2$) - 1

Best Regards - Misi, RRR AB, http://rrr.se

 Hi Misi,

 Your calculation works fine in our Dev environment, but when i use the same
 date calculation in production system it gives this date '01/01/1970
 11:00:31 AM'.


 On Tue, Sep 2, 2014 at 2:50 AM, Misi Mladoniczky m...@rrr.se wrote:

 Hi,

 Could you please describe what you want to accomplish?

 If you want to get the last second of the current month, I would do
 somethinglike:

 DATEADD(month, 1, DATEADD(day, 1-DAY($DATE$), $DATE$)) - 1

 And in two steps:

 Get the first second of the current month:
 firstsecond = DATEADD(day, 1-DAY($DATE$), $DATE$)

 Get the last second based on the first second of the month
 lastsecond = DATEADD(month, 1, $firstsecond$) - 1

 Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP 2011)

 Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13):
 * RRR|License - Not enough Remedy licenses? Save money by optimizing.
 * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs.
 Find these products, and many free tools and utilities, at http://rrr.se.

  Hi All,
 
  Our remedy version is 7.1, Server - Windows 2003 R2 Server, Datebase - MS
  SQL 2005.
 
 
  *In Dev System:*
  I used the below date function in one of the workflow, which worked fine
  and the result were as expected. I got the date is '30/09/2014 11:59:59
 PM'.
 
  DATEADD( day, ( - DATENUM( day, DATEADD( month, 1, $DATE$))),
  DATEADD( month, 1, $DATE$)) + (86400 - 1)
 
 
  *In Production:*
  When i used the same Date function in Production system, it give the Date
  '02/01/1970 11:00:30 AM'
 
  The issue looks very strange and i am unable to figure it out, please
 help
  me on this.
 
  *Thanks and Regards,*
  *Karthick S*
 
 
 ___
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Where the Answers Are, and have been for 20 years
 


 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years




 --


 *Thanks and Regards,*
 *Karthick S*

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Where the Answers Are, and have been for 20 years


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Where the Answers Are, and have been for 20 years


Re: Weird DST date calculation issue - RESOLVED

2010-03-04 Thread William Rentfrow
The suggestion below actually worked -  except I changed it to this: 

DATEADD(day,-10,$My Date$)

William Rentfrow
Principal Consultant, StrataCom Inc.
wrentf...@stratacominc.com
Blog: www.williamrentfrow.com
O 715-592-5185
C 715-410-8056

-Original Message-
From: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] On Behalf Of Charles Baldi
Sent: Tuesday, March 02, 2010 11:14 AM
To: arslist@ARSLIST.ORG
Subject: Re: Weird DST date calculation issue

William,
If you use the dateadd() function do you get a different result?  E.g.,

dateadd(month, -10, date($My Date$))

Regards,
Chuck Baldi

On Tue, Mar 2, 2010 at 12:02 PM, William Rentfrow wrentf...@stratacominc.com 
wrote:
 **

 Fortunately this issue SHOULD be very straight forward.

 Unfortunately - it isn't.

 There's a button that calculates a person's period of eligibility to 
 make changes to their HR benefits, etc.  You enter their employment 
 anniversary date and hit the button and this performs a calculation:

 $My Date$ - 864000 (i.e., minus 10 days).

 Here's the interesting thing - when the date entered is  Daylight 
 savings time - 3/15 this spring - the calculated value for the date 
 time field returns 3/4/2010 11:00:00 PM.  Normally all of the times in 
 this date/time field are left at 12:00:00 AM and are unused.

 Technically speaking the calculation is EXACTLY correct.  3/4/2010 
 11:00:00 PM is exactly 10 days before 3/15/2010 12:00:00 AM - because 
 3/15 has an extra hour added that is a figment of our collective 
 imagination.
 Technically DST doesn't happen until 2:00 AM though but that's a 
 matter for another time.

 I was thinking about changing the times on these to default to 3:00:00 
 AM instead of 12:00:00 AM - but I'm open to suggestions.

 William Rentfrow
 Principal Consultant, StrataCom Inc.
 wrentf...@stratacominc.com
 Blog: www.williamrentfrow.com
 O 715-592-5185
 C 715-410-8056

 _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: Where the 
 Answers Are_

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum 
Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are


Re: Weird DST date calculation issue - RESOLVED

2010-03-04 Thread Charles Baldi
Glad to hear it.  Yeah, I meant to say day but we use month here so...

Regards,
Chuck


On Thu, Mar 4, 2010 at 10:05 AM, William Rentfrow
wrentf...@stratacominc.com wrote:
 The suggestion below actually worked -  except I changed it to this:

 DATEADD(day,-10,$My Date$)

 William Rentfrow
 Principal Consultant, StrataCom Inc.
 wrentf...@stratacominc.com
 Blog: www.williamrentfrow.com
 O 715-592-5185
 C 715-410-8056

 -Original Message-
 From: Action Request System discussion list(ARSList) 
 [mailto:arsl...@arslist.org] On Behalf Of Charles Baldi
 Sent: Tuesday, March 02, 2010 11:14 AM
 To: arslist@ARSLIST.ORG
 Subject: Re: Weird DST date calculation issue

 William,
 If you use the dateadd() function do you get a different result?  E.g.,

 dateadd(month, -10, date($My Date$))

 Regards,
 Chuck Baldi

 On Tue, Mar 2, 2010 at 12:02 PM, William Rentfrow 
 wrentf...@stratacominc.com wrote:
 **

 Fortunately this issue SHOULD be very straight forward.

 Unfortunately - it isn't.

 There's a button that calculates a person's period of eligibility to
 make changes to their HR benefits, etc.  You enter their employment
 anniversary date and hit the button and this performs a calculation:

 $My Date$ - 864000 (i.e., minus 10 days).

 Here's the interesting thing - when the date entered is  Daylight
 savings time - 3/15 this spring - the calculated value for the date
 time field returns 3/4/2010 11:00:00 PM.  Normally all of the times in
 this date/time field are left at 12:00:00 AM and are unused.

 Technically speaking the calculation is EXACTLY correct.  3/4/2010
 11:00:00 PM is exactly 10 days before 3/15/2010 12:00:00 AM - because
 3/15 has an extra hour added that is a figment of our collective 
 imagination.
 Technically DST doesn't happen until 2:00 AM though but that's a
 matter for another time.

 I was thinking about changing the times on these to default to 3:00:00
 AM instead of 12:00:00 AM - but I'm open to suggestions.

 William Rentfrow
 Principal Consultant, StrataCom Inc.
 wrentf...@stratacominc.com
 Blog: www.williamrentfrow.com
 O 715-592-5185
 C 715-410-8056

 _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: Where the
 Answers Are_

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum 
 Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are

 ___
 UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
 Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are


Re: Weird DST date calculation issue - RESOLVED

2010-03-04 Thread Kemes, Lisa
Lucky for you this worked.  It doesn't work for me because I need to keep the 
time the same. (If someone wanted 3.15.2010 at 6:00pm, it has to stay that way) 
The DATEADD Function is great, but it resets the time back to 12:00:00 AM.   

I actually had to parse the data, set aside the time, add the days and then put 
it all back together again in the end.  Works well, but I hate all the extra 
workflow.


Lisa

-Original Message-
From: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] On Behalf Of Charles Baldi
Sent: Thursday, March 04, 2010 10:45 AM
To: arslist@ARSLIST.ORG
Subject: Re: Weird DST date calculation issue - RESOLVED

Glad to hear it.  Yeah, I meant to say day but we use month here so...

Regards,
Chuck


On Thu, Mar 4, 2010 at 10:05 AM, William Rentfrow wrentf...@stratacominc.com 
wrote:
 The suggestion below actually worked -  except I changed it to this:

 DATEADD(day,-10,$My Date$)

 William Rentfrow
 Principal Consultant, StrataCom Inc.
 wrentf...@stratacominc.com
 Blog: www.williamrentfrow.com
 O 715-592-5185
 C 715-410-8056

 -Original Message-
 From: Action Request System discussion list(ARSList) 
 [mailto:arsl...@arslist.org] On Behalf Of Charles Baldi
 Sent: Tuesday, March 02, 2010 11:14 AM
 To: arslist@ARSLIST.ORG
 Subject: Re: Weird DST date calculation issue

 William,
 If you use the dateadd() function do you get a different result?  
 E.g.,

 dateadd(month, -10, date($My Date$))

 Regards,
 Chuck Baldi

 On Tue, Mar 2, 2010 at 12:02 PM, William Rentfrow 
 wrentf...@stratacominc.com wrote:
 **

 Fortunately this issue SHOULD be very straight forward.

 Unfortunately - it isn't.

 There's a button that calculates a person's period of eligibility to 
 make changes to their HR benefits, etc.  You enter their employment 
 anniversary date and hit the button and this performs a calculation:

 $My Date$ - 864000 (i.e., minus 10 days).

 Here's the interesting thing - when the date entered is  Daylight 
 savings time - 3/15 this spring - the calculated value for the date 
 time field returns 3/4/2010 11:00:00 PM.  Normally all of the times 
 in this date/time field are left at 12:00:00 AM and are unused.

 Technically speaking the calculation is EXACTLY correct.  3/4/2010 
 11:00:00 PM is exactly 10 days before 3/15/2010 12:00:00 AM - because
 3/15 has an extra hour added that is a figment of our collective 
 imagination.
 Technically DST doesn't happen until 2:00 AM though but that's a 
 matter for another time.

 I was thinking about changing the times on these to default to 
 3:00:00 AM instead of 12:00:00 AM - but I'm open to suggestions.

 William Rentfrow
 Principal Consultant, StrataCom Inc.
 wrentf...@stratacominc.com
 Blog: www.williamrentfrow.com
 O 715-592-5185
 C 715-410-8056

 _Platinum Sponsor: rmisoluti...@verizon.net ARSlist: Where the 
 Answers Are_

 __
 _ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org 
 Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are

 __
 _ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org 
 Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are


___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org Platinum 
Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are


Re: Weird DST date calculation issue

2010-03-02 Thread Shellman, David
Bill,

It's taken me a long time to understand this issue.  Still haven't figured out 
a good solution.  The effect is because of the observance of DST when it 
changes.  The issue is that you are subtracting a constant from the date.  
Where DST is observed, 2 days out of the year are not 24 hours.  In the 
statements below I will reference dates in the US but the concept is the same 
for any where that observes DST.

March 14th is a short day.  That day is 23 hours in length.  So 864000 is not 
exactly 10 days during that time period.  864000 translates to 10 days and 1 
hour until after march 15th in your case.

On November 7th this year you have the opposite effect.  November 7th is a 25 
hour day.  864000 would translate to 9 days and 23 hours until after November 
17th.

Hope this helps with the understanding of what is happening.

Dave

From: Action Request System discussion list(ARSList) 
[mailto:arsl...@arslist.org] On Behalf Of William Rentfrow
Sent: Tuesday, March 02, 2010 12:03 PM
To: arslist@ARSLIST.ORG
Subject: Weird DST date calculation issue

**

Fortunately this issue SHOULD be very straight forward.

Unfortunately - it isn't.

There's a button that calculates a person's period of eligibility to make 
changes to their HR benefits, etc.  You enter their employment anniversary date 
and hit the button and this performs a calculation:

$My Date$ - 864000 (i.e., minus 10 days).

Here's the interesting thing - when the date entered is  Daylight savings time 
- 3/15 this spring - the calculated value for the date time field returns 
3/4/2010 11:00:00 PM.  Normally all of the times in this date/time field are 
left at 12:00:00 AM and are unused.

Technically speaking the calculation is EXACTLY correct.  3/4/2010 11:00:00 PM 
is exactly 10 days before 3/15/2010 12:00:00 AM - because 3/15 has an extra 
hour added that is a figment of our collective imagination.  Technically DST 
doesn't happen until 2:00 AM though but that's a matter for another time.

I was thinking about changing the times on these to default to 3:00:00 AM 
instead of 12:00:00 AM - but I'm open to suggestions.

William Rentfrow
Principal Consultant, StrataCom Inc.
wrentf...@stratacominc.com
Blog: www.williamrentfrow.comfile://www.williamrentfrow.com
O 715-592-5185
C 715-410-8056

_Platinum Sponsor: rmisoluti...@verizon.net ARSlist: Where the Answers Are_

___
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:rmisoluti...@verizon.net ARSlist: Where the Answers Are