SQL query error

Hello, 

I am trying to create this query to calculate opportunity age:

SELECT opportunities.id opportunity_id, opportunities.name opportunity_name, datediff(date(now()), date(opportunities.date_created)) opportunity_age_in_days, date(opportunities.date_created) created_at, date(opportunities.date_modified) updated_at, date(opportunities.date_closed) as closed_at
FROM opportunities

however I keep getting this error: 

Not Found

The requested URL was not found on this server.

Could you please let me know why?

Parents Reply
  • So you mean because the workflow only sets the date to "today" when the Opp is won? Create a second SugarBPM that does the same if a Opp get lost.

    Or is this for existing Opps that are already lost and you are looking for the correct timestamp? If this is the case I think this might be solved with an SQL statement via database similiar to the one you've asked for initally but in my experience if we implement a new solution in an existing instance especially "lost opps" from the past are not that important and can be filtered out for a while in reports if everyone else using this reports agrees.

    If an SQL statement is needed for updating the records keep in mind Sugar Support is able to run it on your instance but you need to deliver the working SQL statement to them.

    Hope that helps :-)

    Bests

    Björn

Children
No Data