Clarity

  • 1.  Nsql Command

    Posted Sep 01, 2018 11:31 AM

    Hi,

     

    I need to compare to dates  from different tasks , finish date vs today. But I don't know the nsql command to do that. Anybody can help me?

     

    I tried to do a gridline portlet with past due tasks without link from portlet graph Schedule performance.

     

    Thanks in advance,

     

    Cira



  • 2.  Re: Nsql Command

    Posted Sep 01, 2018 03:38 PM

    If you put your main SQL inside a wrapper you could have there

     

    SELECT

    .....

     

    CASE
    WHEN t.prfinish > getdate()  then 'Late'
    WHEN t.prfinish < getdate()  then 'In schedule'
    WHEN t.prfinish = getdate()  then 'Just in time'

    ELSE  'Error'
    END
    Task_comparison

     

    .....

     


    from

     

    ......

    prtask t

     

    establish what is the function in your system for the current date (if getdate does not work)

    Bear in mind that normally the date data includes time so the equal condition is hardly ever met.

    If you want to use just date then you should pick a date format that only includes date.



  • 3.  Re: Nsql Command

    Posted Sep 02, 2018 10:11 AM

    Thank you Urmas,

     

    Getdate() didn't work. I try now(), sysdatetime(), today(), datetime() but all of them was and invalid expression.

     

    Some body know how  can I do that. I want to compare the actual finish with today in order to know if the task are late 

     

    Regards,

     

    Cira



  • 4.  Re: Nsql Command

    Posted Sep 02, 2018 01:05 PM

    Then have to start at the beginning.

    Is it Oracle or MS SQL?

    Could you please share the sql query you have?



  • 5.  Re: Nsql Command
    Best Answer

    Broadcom Employee
    Posted Sep 03, 2018 12:24 AM

    Hi Cira,

     

    You probably use Oracle.

    Please try to use SYSDATE or CURRENT_DATE.

     

    Regards,

    Shoichi



  • 6.  Re: Nsql Command

    Posted Sep 07, 2018 10:55 AM

    Thanks Shoichi,

     

    Regards



  • 7.  Re: Nsql Command

    Posted Sep 04, 2018 11:42 PM

    Also note, task dates include date/time, with most finish dates may be finishing at 5:00pm.  Please consider adding 'trunc' to your comparisons (eg trunc(prfinish) = trunc(sysdate) then 'Just in Time')



  • 8.  Re: Nsql Command

    Posted Sep 07, 2018 10:55 AM

    Thanks Roland

     

    Regards