Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / March 2008

Tip: Looking for answers? Try searching our database.

Query Help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mahmad - 09 Mar 2008 20:51 GMT
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
Jerry Whittle - 10 Mar 2008 15:06 GMT
Removing the following from the WHERE clause should do it:

(dbo.salesorders.srep = 'blue') AND

Also you don't need the DISTINCT.
Signature

Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

> Hi,
>
[quoted text clipped - 37 lines]
>
> Mo
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.