tee
tee

Reputation: 1336

Sql dividing a value returned from a query with another Access

I created a query that returned one value. For example here's the query:

Select AVG(hours_worked) FROM table1

I want to get this value and divide it by 7.5...I've tried:

(Select AVG(hours_worked) FROM table1) / 7.5

And I've also tried other solutions. Any help would be great!

Thanks!

Upvotes: 0

Views: 34

Answers (2)

tee
tee

Reputation: 1336

I figured it out. All i had to do was this:

Select avg_hours/7.5 FROM (SELECT AVG(hours_worked) AS avg_hours FROM table1)

Upvotes: 0

Gordon Linoff
Gordon Linoff

Reputation: 1269863

Do the division in the select:

SELECT AVG(hours_worked) / 7.5
FROM table1;

Upvotes: 1

Related Questions