Menu

some saved queries doesnt work

Help
2016-05-10
2016-05-13
  • david avraham

    david avraham - 2016-05-10

    Im trying to use "SELECT * FROM <MYSAVEDQUERY>"

    it works with simple select from where queries. but fails in queries like "SELECT Changes.ChangeType, Changes.Workflow, Count(*) AS NoOfChanges, Round(Avg(Changes.WorkflowDuration),2) AS AvgWorkflowDuration
    FROM Changes INNER JOIN RelevantChanges ON Changes.ChangeNumber = RelevantChanges.ChangeNumber
    GROUP BY Changes.ChangeType, Changes.Workflow;"

    (i get "user lacks privilege or object not found")

    i assume it is connected to one of the functions although if i hard code this query without a saved query it works fine

    any ideas?

     

    Last edit: david avraham 2016-05-10
  • Marco Amadei

    Marco Amadei - 2016-05-13

    AVG doesn't allow null values here. Use
    Round(Avg(Nz(Changes.WorkflowDuration,0.0)),2)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.