Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

query help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mahmad - 10 Mar 2008 12:44 GMT
Hi,

I want to bring up the following data for groups:
Blue, Red, Green and Yellow.

I have the following view in sql 7 which brings up the data i want,  How can
i bring up the data for the other groups within the same 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

I then need to call this query witin MS Access and use it to output to a
Data sheet.

Thanks

Mohammad
mahmad - 10 Mar 2008 12:49 GMT
A little more info.

The data i want will look like this as an example:

Team        price          Date
====       ====        ===
Blue          500           01/01/2008
Green       600            04/02/2008
Yellow      2000           01/02/2008

> Hi,
>
[quoted text clipped - 26 lines]
>
> Mohammad
 
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



©2009 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.