Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

how to get the difference between two dates in terms od days

asharaniasharani Member Posts: 10
hello!
i am having 1 query for which i am not getting the soln and it is as
find the number of days ellapsed between today's date and date of orders plased by customers.


Comments

  • ankaramankaram Member Posts: 5
    : hello!
    : i am having 1 query for which i am not getting the soln and it is as
    : find the number of days ellapsed between today's date and date of orders plased by customers.
    :
    :
    :
    i seen your problem and i have a solution for that ,
    use month_between(columnname ,columnname)
  • infidelinfidel Member Posts: 2,900
    : : hello!
    : : i am having 1 query for which i am not getting the soln and it is as
    : : find the number of days ellapsed between today's date and date of orders plased by customers.
    : :
    : :
    : :
    : i seen your problem and i have a solution for that ,
    : use month_between(columnname ,columnname)

    He want's days, not months. Oracle's dates can be subtracted to yield the number of days between them.

    --today
    select sysdate from dual;

    --yesterday
    select sysdate - 1 from dual;

    --first day of month
    select trunc(sysdate, 'MM') from dual;

    -- days since first day of month
    select sysdate - trunc(sysdate, 'MM') from dual;


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • asharaniasharani Member Posts: 10
    : : : hello!
    : : : i am having 1 query for which i am not getting the soln and it is as
    : : : find the number of days ellapsed between today's date and date of orders plased by customers.
    : : :
    : : :
    : : :
    : : i seen your problem and i have a solution for that ,
    : : use month_between(columnname ,columnname)
    :
    : He want's days, not months. Oracle's dates can be subtracted to yield the number of days between them.
    :
    : --today
    : select sysdate from dual;
    :
    : --yesterday
    : select sysdate - 1 from dual;
    :
    : --first day of month
    : select trunc(sysdate, 'MM') from dual;
    :
    : -- days since first day of month
    : select sysdate - trunc(sysdate, 'MM') from dual;
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :
    :

  • asharaniasharani Member Posts: 10
    : : : hello!
    : : : i am having 1 query for which i am not getting the soln and it is as
    : : : find the number of days ellapsed between today's date and date of orders plased by customers.
    : : :
    : : :
    : : :
    : : i seen your problem and i have a solution for that ,
    : : use month_between(columnname ,columnname)
    :
    : He want's days, not months. Oracle's dates can be subtracted to yield the number of days between them.
    :
    : --today
    : select sysdate from dual;
    :
    : --yesterday
    : select sysdate - 1 from dual;
    :
    : --first day of month
    : select trunc(sysdate, 'MM') from dual;
    :
    : -- days since first day of month
    : select sysdate - trunc(sysdate, 'MM') from dual;
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    : [code]
    : $ select * from users where clue > 0
    : no rows returned
    : [/code]
    :

    tank u very much for your efforts actually this not what i want
    i got the solution i wnt to share it with u
    select (s_order_date,round(sysdate));

    :

Sign In or Register to comment.