Skip to main content

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
​​

 

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


Hi @Lee Pinchbeck,

 

I tried before it gives an error. 

 


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


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 :)

 

 

 


Hello @hhy38 ,

 

Have you solved your problem ?

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


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


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 ?  

 


Hi @cilik,

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

Kind regards,

Lee Pinchbeck


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

Sincerely.


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


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.