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

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

  • : 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)
  • : : 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]

  • : : : 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]
    :
    :

  • : : : 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.

Howdy, Stranger!

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

Categories