M
mahmad
Hi,
I am hoping someone can help me. What i am trying to do overall is to get
data out of my sql db. Build a quiery within Access and output the data as a
ms datasheet with a chart. Sorry for the long question. I am not great with
sql and access.
So within my sql db i have 4 groups.
Red, Blue,Green, Yellow
When a sale is taken it is given to a group as above.
What i want to do is to pull up the data for each group sum the total sale
and display both the group, the total sale and the date onto a data access
sheet and on a chart.
I have setup a view within my sql server, which gives me the data i need. I
need to put all data into one quiery in ms access, how can i do this.
The query below is in my sql db and pull all the data i need for one group.
Is there an easier way to pulling all the data for all groups with this query.
SELECT DISTINCT
salesorders.srep, SUM(salesitems.sprice) AS Expr1,
delv.dtaxd
FROM dbo.salesorders INNER JOIN
dbo.salesitems ON
dbo.salesorders.son = dbo.salesitems.sona INNER JOIN
dbo.delvitems ON
dbo.salesorders.son = dbo.delvitems.dord AND
dbo.salesitems.sonitem = dbo.delvitems.ditem INNER JOIN
dbo.delv ON
dbo.delvitems.delvnoa = dbo.delv.delvno
WHERE (dbo.salesorders.srep = 'blue') AND
(dbo.delv.dedate > CONVERT(DATETIME,
'2008-02-01 00:00:00', 102))
GROUP BY dbo.salesorders.srep, dbo.delv.dtaxd
Thanks for all your help
Mo
I am hoping someone can help me. What i am trying to do overall is to get
data out of my sql db. Build a quiery within Access and output the data as a
ms datasheet with a chart. Sorry for the long question. I am not great with
sql and access.
So within my sql db i have 4 groups.
Red, Blue,Green, Yellow
When a sale is taken it is given to a group as above.
What i want to do is to pull up the data for each group sum the total sale
and display both the group, the total sale and the date onto a data access
sheet and on a chart.
I have setup a view within my sql server, which gives me the data i need. I
need to put all data into one quiery in ms access, how can i do this.
The query below is in my sql db and pull all the data i need for one group.
Is there an easier way to pulling all the data for all groups with this query.
SELECT DISTINCT
salesorders.srep, SUM(salesitems.sprice) AS Expr1,
delv.dtaxd
FROM dbo.salesorders INNER JOIN
dbo.salesitems ON
dbo.salesorders.son = dbo.salesitems.sona INNER JOIN
dbo.delvitems ON
dbo.salesorders.son = dbo.delvitems.dord AND
dbo.salesitems.sonitem = dbo.delvitems.ditem INNER JOIN
dbo.delv ON
dbo.delvitems.delvnoa = dbo.delv.delvno
WHERE (dbo.salesorders.srep = 'blue') AND
(dbo.delv.dedate > CONVERT(DATETIME,
'2008-02-01 00:00:00', 102))
GROUP BY dbo.salesorders.srep, dbo.delv.dtaxd
Thanks for all your help
Mo