1. siddharth agashe
  2. PowerBuilder
  3. Friday, 18 August 2017 13:52 PM UTC

Seeing different results on datetimes returned by reference from ASE 16 Stored procedures. 

When the time stamp is 00:00:00, the procedures returns 12 AM (00:00:00) from PB, but 12 PM (12:00:00) from Appeon.  This can cause issues when dates are compared.

Example Proc:

create PROCEDURE dbo.test_p ( @effective_date datetime = null output)

as
 begin 

    set @effective_date = '3/1/13'

end

 go

 GRANT EXECUTE ON dbo.test_p TO public

 Example PB Code:

 datetime ldt_effective

 sqlca.test_p(ldt_effective)

 if sqlca.sqlcode <> 0 then
             messagebox( string(sqlca.sqlcode), sqlca.sqlerrtext )
 else
             Messagebox( 'mar 1, 2013 00:00:00', string( ldt_effective ) )
 end if

RPC Delcaration: 

function long test_p(ref datetime effective_date) RPCFUNC ALIAS FOR "dbo.test_p"

 PB Results:

    • 3/1/13 00:00:00 (midnight)

Appeon Results:

    • 3/1/13 12:00:00 (noon)

 

 

I have tried hardcoding the date in appeon but it is not the right way for the solution.

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 18 August 2017 14:33 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Siddharth;

  All dates & times in PB & Appeon products are of the ANSI standard. Please use "CCYY-DD-MM" and  "HH:MM:SS:TTTT" ANSI format for all your date & time manipulations.

HTH

Regards ... Chris

Comment
  1. siddharth agashe
  2. Tuesday, 22 August 2017 18:51 PM UTC
Hi Chris,



Thanks for your response , we tried to implement it by the following command:



ls_date =  string(DateTime(ldt_eff_date), 'YYYY/MM/DD HH:MM:SS:TTTT')



It only gives the time as 00:00:00 irrespective of time.



Am I missing on something.



 

  1. Helpful
  1. siddharth agashe
  2. Tuesday, 22 August 2017 21:10 PM UTC
Hi Chris,



Thanks for your response , we tried to implement it by the following command:



ls_date =  string(DateTime(ldt_eff_date), 'YYYY/MM/DD HH:MM:SS:TTTT')



It only gives the time as 00:00:00 irrespective of time.



Am I missing on something.

  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.