Menu

Format Date Parameter In jxls

ART Help
Andra VP
2023-01-23
2023-01-24
  • Andra VP

    Andra VP - 2023-01-23

    Hi,
    I want to format date parameter to YYYY-MM-DD Can you help me to format date from date parameter (date1.sqlValue and date2.sqlValue)?
    Here is my script:

    jx:each(items="jdbc.query('select * from orders where to_char(due_date, 'yyyy-mm-dd') between ? And ?', date1.sqlValue,date2.sqlValue)" var="item" lastCell="B3")

     
  • Timothy Anyona

    Timothy Anyona - 2023-01-23

    What database are you using?

     
  • Andra VP

    Andra VP - 2023-01-24

    I use postgresql

     
  • Timothy Anyona

    Timothy Anyona - 2023-01-24
    1. What is the data type of the due_date column?
    2. What is the data type of the date1 and date2 parameters?
     
  • Andra VP

    Andra VP - 2023-01-24

    Here is:
    1. due date = timestamp
    2. date1 and date2 = Date

     
  • Timothy Anyona

    Timothy Anyona - 2023-01-24

    What version of ART are you using?

     
  • Andra VP

    Andra VP - 2023-01-24

    I use ART 5.16

     
  • Timothy Anyona

    Timothy Anyona - 2023-01-24

    What if you try

    jx:each(items="jdbc.query('select * from orders where due_date between '+date1.sqlValue+' AND '+date2.sqlValue)" var="item" lastCell="B3")

     

Log in to post a comment.