×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Help with functions

Help with functions

Help with functions

(OP)
Hello this is my SQL statement:
SELECT date_trunc('minute',AVG(AGE(t.close_date,t.creation_date))) AS TimeFrame, COUNT(t.task_id) , t.assigned_id AS Asignee, w.client_id AS Organization FROM task AS t,workbasket AS w WHERE t.location_name iLIKE 'Sales%'|| '|' || 'Create Work Order%' AND t.assigned_id='organ' AND w.client_id iLIKE '100-%' AND w.task_id = t.task_id GROUP BY t.assigned_id, w.client_id

I am not getting a value for the first select.  The problem is or at least I think, is that there is only one value in the database that fits the requirements, so I am thinking that running AVG on just one value returns nothing.  Am I wrong?  If I am right how can I get around this, any suggestions.  

Thanks

RE: Help with functions

(OP)
Disregard this question, I figured it out myself, it had nothing to do with the AVG function not working on 1 value, it was my SQL....go figure....I was using the wrong primary key.

thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close