Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Join query?

Author  Topic 

echofive
Starting Member

1 Post

Posted - 2008-07-06 : 03:44:44
Hi,

I'm trying to write a SQL statement that will add up the numbers in a column and group them by an ID, then add information from another table(s) based on the same ID.

so what I've come up with that I can get to work, works by createing views...

create view Totalsales As
Select SUM(orders.total) as Totals, orders.employeeid
from orders
group by orders.employeeid;
select totalsales.totals, employees.firstname, employees.lastname
from totalsales, employees
where employees.employeeid=totalsales.employeeid

which works well, except I need to perform this statement from our a peice of sofrware that unfortunately does not let you create views....

The DB is an access DB. I can't figure out another way to get the results I want... if any more info is required please let me know.

Thank you in advance

Kyle

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2008-07-07 : 03:15:23
Sample input data and sample MATCHING expected results would help.
Go to Top of Page
   

- Advertisement -