• Resolved a608237

    (@a608237)


    I have a dropdown field (fieldname30) and a date picker field (fieldname1).

    I have a table like:

    
    User | Date
    John  2019-05-06
    Mike  2019-03-13
    Frank 2019-05-08

    I want fieldname30 to display the User depending on the date picked on fieldname1.

    So in the fieldname30 query, I have:

    Select User as value, User as text from table WHERE Date = <%fieldname1%>.

    However, despite selecting the corresponding dates, fieldname30 is always blank. I’ve set the date format of the datepicker to use dashes (‘-‘), the date parts in the Date column are also dash separated. What is wrong?

    I’ve wrote similar logic for fields where values displayed are based on non date fields and those seem to work fine.

    • This topic was modified 6 years, 11 months ago by a608237.
Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @a608237

    The alternative would be to use a calculated field as auxiliary (you can hide this field ticking a checkbox in its settings). So, assuming the calculated field is the fieldname123, enter as its equation the following piece of code:

    
    CDATE(fieldname1, 'yyyy-mm-dd')
    

    and then, use the calculated field in the query:

    
    Select User as value, User as text from table WHERE Date = '<%fieldname123%>'
    

    Note: I’m including the date between single quotes because it is a text.

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘datepicker date format vs MySQL date column’ is closed to new replies.