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
  • For my advanced report, I am also looking for the following information (apologies, I am a rookie on Advanced Reports in Sugar): 

    1. What is the SQL engine of SugarCRM? Is it MySQL, SQL Server, etc? Need to understand this in order to know what syntax I should use for functions. So far I've inferred that it is MySQL, but I just wanted to be sure.

    2. Can I perform a subquery inside a query? For example, I would like to do SELECT * FROM (SELECT * FROM opportunities), but it is not letting me. It's outputting a "Page Not Found" error when I try to save the query.

    Point 2 is very important for me to compute models for calculations. Thanks!

Children