1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] SQL QUERY NOT FETCHING CORRECT NUMMBER RECORDS

Discussão em 'Outras Linguagens' iniciado por Stack, Novembro 3, 2024 às 09:33.

  1. Stack

    Stack Membro Participativo

    I have a below SQL query. When I mention the date and time explicitly it shows correct number of records.

    select * from annual_report_order where report_order_date >= '29-OCT-2024 00:00:00.000' AND report_order_date <= '02-NOV-2024 23:59:59.000'

    however, when I use sysdate output shows less number number rows.

    select * from annual_report_order where report_order_date >= sysdate-5 AND report_order_date <= sysdate-1

    column report_order_date has datatype as TIMESTAMP(6)

    Actually my aim is make automate and use scheduler and run this sql query every Sunday having report_order_date condition from Monday 00:00 till Saturday 23:59:59.

    Could you please advise why sysdate shows less number of records. thanks in advance

    Continue reading...

Compartilhe esta Página