Solved

About Customer Order History Api

  • 30 November 2020
  • 11 replies
  • 222 views

Userlevel 5
Badge +14
  • Hero (Customer)
  • 275 replies

I am trying to add a history record via events to customer orders when a variable area changes. But the date which I send as a sysdate is inserting wrong. I tried to format the date but it did not work. What is the correct format?

 

Wrong Date
​​

 

icon

Best answer by hhy38 30 November 2020, 15:25

View original

This topic has been closed for comments

11 replies

Userlevel 7
Badge +24

Hi @hhy38,

It looks like you need to flip the date. At the moment you day is going in as the year and the year is going in as the day so you need YYYY-MM-DD.

Kind regards,

Lee Pinchbeck

Userlevel 5
Badge +14

Hi @Lee Pinchbeck,

 

I tried before it gives an error. 

 

Userlevel 7
Badge +24

Hi @hhy38,

Are you able to translate the error? If you are able to provide the expanded detail of the error as well that should help.

Kind regards,

Lee Pinchbeck

Userlevel 5
Badge +14

Hi @Lee Pinchbeck,

 

The error says the Month should be 1 and the last day of the month. Thank you for your effort. I solve the problem. I saw variables on the right side then I cried :)

 

 

 

Badge +5

Hello @hhy38 ,

 

Have you solved your problem ?

If you've, could you please share the solution ? 

Userlevel 7
Badge +24

Hi @cilik,

To clarify the best answer post: rather than use sysdate and try to interpret how this should be formatted @hhy38 instead used the available variable NOW which does that all for you.

Kind regards,

Lee Pinchbeck

Badge +5

Hi @Lee Pinchbeck 

Thank you for your answer. Actually I wonder if there is another way ? 

I have the same problem but mine is in PLSQL.

You can see what i’ve experienced below.

I am looking for solution of that problem. Do you have any idea ?  

 

Userlevel 7
Badge +24

Hi @cilik,

Have you tried using CURRENT_DATE in the same manner as NOW was used in this posts example?

Kind regards,

Lee Pinchbeck

Badge +5

@Lee Pinchbeck yes I’ve. Unfortunatelly it doesn’t work. 

Sincerely.

Userlevel 5
Badge +14

Hi @cilik,

You can use to_char(SYSDATE, 'YYYY-MM-DD-HH24.MI.SS') instead of TO_DATE(to_char(sysdate, ‘DD.MM.YYYY’), ‘DD.MM.YYYY’)

Regards,

Hasan

Badge +5

Hi @hhy38,

  I’ve tried to_char(SYSDATE, 'YYYY-MM-DD-HH24.MI.SS').

 Result is the same. It is inserted as 21/02/0025 to table.

Regards.