Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
wallace_santos
New Member

OLE DB or ODBC error: Query (26,47) The syntax is incorrect

Hi, I have this
error in OLE DB or ODBC visuals: Query (26,47) The syntax is incorrect

calculated column: 

Tempo_reparo (horas paradas) = IF(OR(F_Indisponibilidade[unavailability_reason_text]="Indisponibilidade Motorista",OR(F_Indisponibilidade[unavailability_reason_text]="Preventiva",OR(F_Indisponibilidade[unavailability_reason_text]="Frota Legal",F_Indisponibilidade[unavailability_reason_text]="Sinistro"))), BLANK(),(DATEDIFF(F_Indisponibilidade[Inicio Indisponibilidade],F_Indisponibilidade[Fim Indisponibilidade],SECOND)/3600))


Column is Time_repair (MTTR_decimal).

WhatsApp Image 2024-05-06 at 16.59.29.jpeg

2 REPLIES 2
wallace_santos
New Member

The error still persists

Anonymous
Not applicable

Hi @wallace_santos 

 

The nested functions seem to be the source of complexity and potential error.
Maybe you can refactor it for clarity and correctness like this:

Tempo_reparo (horas paradas) =
IF (
    F_Indisponibilidade[unavailability_reason_text]
        IN { "Indisponibilidade Motorista", "Preventiva", "Frota Legal", "Sinistro" },
    BLANK (),
    (
        DATEDIFF (
            F_Indisponibilidade[Inicio Indisponibilidade],
            F_Indisponibilidade[Fim Indisponibilidade],
            SECOND
        ) / 3600
    )
)

 

Best Regards

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors