Big struggle with callback

I was making really good progress with my dash app until I got stuck on this callback…

@app.callback(
    Output('output-container-date-picker-single', 'children'),
    Input('my-date-picker-single', 'date'))
def update_output(date_value):
    if date_value is not None:
        date_object = date.fromisoformat(date_value)
        date_string = date_object.strftime('%B %d, %Y')
        return date_string
    if date_value is None:
        date_objectx = date.fromisoformat(date)
        date_string = date_objectx.strftime('%B %d, %Y')
        return date_string


pickedDate = update_output

SLGordersAc = """SELECT COUNT(slg.id) AS slg_orders_accepted 
    FROM zz_liab_visionlabs.slg_failure slg 
    WHERE slg.slg_declined_reason_id = 0 
    AND slg.reviewed_date = ?"""
    cursor.execute(SLGordersAc, pickedDate)

Hi,

Could you please elaborate a bit more on what you want to accomplish and if there are any errors or how the outcome of this callback is not what you want/expect? :slight_smile: