I found this great rollup query example that uses grouping and sub
totals. Would it be possible to expand on this and include a group
within a group and subtotal each group? For example, parent product then
child product? Help appreciated. Thanks.
Frank
SQL:
SELECT
CASE
WHEN (Grouping(CategoryName)=1) THEN 'MainTotal'
ELSE CategoryName
END AS CategoryName,
CASE
WHEN (Grouping(ProductName)=1) THEN 'SubTotal'
ELSE Productname
END AS ProductName,
Sum(UnitPrice) as UnitPrice,
Sum(UnitsinStock) as UnitsInStock
FROM Products
INNER JOIN Categories On
Products.CategoryID = Categories.CategoryID
GROUP BY CategoryName, ProductName WITH ROLLUP
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
I am encountering an error: Server: Msg 8120, Level 16, State 1, Line 25 Column 'CALLSTARTTIME' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Here's the query: SELECT
CASE WHEN (GROUPING(DATEPART(yy, CALLSTARTTIME))=1) THEN 'Total' ELSE DATEPART(yy, CALLSTARTTIME) END AS 'Year', Count(*) as 'Total Calls' FROM CALL_LOG_MASTER GROUP BY DATEPART(yy, CALLSTARTTIME) with ROLLUP ORDER BY DATEPART(yy, CALLSTARTTIME)
Hi,I am attempting to achieve some form of report that needs to make use of sql rollup and display it as follows:Category Subject Matter1 Subject Matter2 Subject Matter3 No of CasesClubs Facilities Sport Facilities Swimming Pool 3 SubTotal 3Events SBR/AHM NULL NULL 1 SubTotal 1 GrandTotal 4However, with my sql query, using roll up, it will look like the following which is not correct.Category Subject Matter1 Subject Matter2 Subject Matter3 No of CasesClubs Facilities Sport Facilities Swimming Pool 3Clubs Facilities Sport Facilities NULL 3Clubs Facilities NULL NULL 3Clubs Sub Total NULL NULL 3Events SBR/AHM NULL NULL 1Events SBR/AHM NULL NULL 1Events SBR/AHM NULL NULL 1Events Sub Total NULL NULL 1This is the query I am using:<code>select casewhen (grouping(Cat.Description)=1) then 'Grand Total'else Cat.Descriptionend as Category,casewhen (grouping(sub.description)=1) then 'Sub Total'else Sub.descriptionend as SM1,SubSub.Description as SM2, SM.Description as SM3, count(sub.description)from tb_feedbackcase FB left join tb_category Cat on FB.Category_ID = Cat.Category_ID left join tb_subcategory Sub on FB.SubCategory_ID = Sub.SubCategory_IDleft join tb_subsubcategory SubSub on FB.SubSubCategory_ID = SubSub.SubSubCategory_IDleft join tb_SubjectMatterLV3 SM on FB.SM3_ID = SM.SM3_IDwhere fb.commenttype_id in (select commenttypes_id from tb_comment_types where description = @feedback_type)and convert(char(10),feedback_datetime,102) >= convert(char(10),@date_from, 102)and convert(char(10), feedback_datetime, 102) <= convert(char(10),@date_to, 102)group by Cat.Description, Sub.Description, SubSub.Description, SM.Description with rollup</code>How can I change it to reflect more accurately? Please help. Thanks.
l would like to get totals at the bottom of the following columns
SELECT sum(capital_Amount) AS Capital_Amount, sum(interest_Amount) AS Interest_Amount, sum(total_Amount) AS Total_Amount, sum(admin_Fee) AS Admin_Fee
to sum up all totals by column. i tried using the rollup,cube like in oracle no luck. Whats the best way of achieving this? if l have to write it as a function how would l do that?
Alter View Test2 As SELECT loan_No AS Loan_No, date_Issued AS Date_Issued, store AS Store, product AS Product, capital_Amount AS Capital_Amount, interest_Amount AS Interest_Amount, total_Amount AS Total_Amount, admin_Fee AS Admin_Fee, user_Issued AS User_Issued, LoanBook AS Company, status FROM Loan
I have two tables - the first contains machine info, and the second contains monthly readings.
Table1 Serial, Model, Location, etc...
Table2 Serial, Year, Month, Reading
I would like to write a query that gives me one row for each machine that has the serial, model, and the reading for the previous 12 months. The date will be passed into the query
insert into tmpTable values ('table', 'blue', 12) insert into tmpTable values ('table', 'red', 100) insert into tmpTable values ('table', 'white', 50) insert into tmpTable values ('chair', 'blue', 12) insert into tmpTable values ('chair', 'red', 1) insert into tmpTable values ('chair', 'white', 123) insert into tmpTable values ('chair', 'yellow', 50)
SELECT CASE WHEN (GROUPING(prod_name) = 1) THEN 'Grand Total' ELSE ISNULL(prod_name, 'UNKNOWN') END AS Item, CASE WHEN (GROUPING(prod_color) = 1) and grouping(prod_name) != 1 THEN 'Sub Total' when grouping(prod_color) = 1 and grouping(prod_name) = 1 then '' ELSE ISNULL(prod_color, 'UNKNOWN') END AS Color, SUM(quantity) AS QtySum FROM tmpTable GROUP BY prod_name, prod_color WITH ROLLUP
--drop table tmpTable
I want to be able to do an order by for each section of the rollup so that the quantity can be asc for both the chair part of the query and the table part.
Hi, Can anyone explain me that WHAT IS CUBE AND ROLLUP Statments for?? Why to use, Where to use and When to use??? Are they usefull in any point of view from ADO.NET???
I would like to only have 1 column rollup but I still need the other columns in the output. Here is my T-SQL code:
This is the current output:
0 2007-02-14 00:00:00 test test 03-Barnes Healthcare Services 246.00 0 2007-02-14 00:00:00 test test 03-Barnes Healthcare Services 246.00 0 2007-02-14 00:00:00 test test NULL 246.00 0 2007-02-14 00:00:00 test NULL NULL 246.00 0 2007-02-14 00:00:00 NULL NULL NULL 246.00 ... ... 0 NULL NULL NULL NULL 3992230.50
I would like it to look like this:
0 2007-02-14 00:00:00 test test 03-Barnes Healthcare Services 246.00 .. ... 0 NULL NULL NULL NULL 3992230.50
I only want the total on the 1st column, but it rollups all of the columns.
Code Snippet
SELECT ServiceTypeCode, ServiceDate, IFirst, ILast, VendorName, Sum(ISNULL(AfterDiscountAmt,0)) AS Amount FROM Holding_Billable WHERE DocumentDate BETWEEN '1/1/2007' AND '12/31/2007' AND SiteCode = 7001 GROUP BY ServiceTypeCode, ServiceDate, IFirst, ILast, VendorName, AfterDiscountAmt WITH ROLLUP
So I'm making some kind of vain attempt to follow this tutorial to get summary rows, and I've followed it as best I can to the letter using my own data. But when I try to run the query, it tells me there's a syntax error near "WITHROLLUP". Am I missing something?
SELECT CASE GROUPING(Employee) WHEN 0 THEN Employee ELSE 'Total' END AS TheEmployee, CASE GROUPING(ID) WHEN 0 THEN ID ELSE - 1 END AS TheID, SUM(WorkDays) AS TotDays FROM EmpScheduleExceptions WHERE (YEAR(Start) = YEAR(GETDATE())) GROUP BY Employee, ID WITH ROLLUP ORDER BY Employee, TotDays
I'm struggling to fin a way to use DISTINCT keyword with ROLLUP (or Cube).For example,SELECT employee_city, employee_country, COUNT(DISTINCT employee_name)FROM employeeGROUP BY employee_city, employee_country WITH ROLLUPthat query does not work.Is there a workaround?Thx.
Is it possible to roll up all child records into one comma delimited field? For example, if the parent table is league info, and the child table is team info, I would be looking to return results like this:
Field 1 Field 2 NFL Bears, Browns, Saints, etc NBA Bulls, Celtics, Lakers, etc
MS has been nice enough to add the Cube and Rollup operators so I canhave totals with my results.But out of shear meanness they won't let me use them unless I use aGroup By clause in my select. I have a proc with 25 fields, and haveno desire to Group By anything- when a certain field changes, I justwant a row with the total of that field.Is this possible?Thanks,Burt
The problem is, I want items on every line, like transaction dates, that are neither grouped by or summed. They are just for information only.
ANSI-92 SQL does not allow any column to be selected that is either not grouped on or has an aggregate function performed.
The MS example in the link above works fine, but does not present much data.
If I wanted to sum total orders and each order's subtotal for a given customer, I would also likely want the order date, who the order was placed by, etc. in each line of the report without grouping or summing that extraneous info.
Here is an example of the SQL syntax:
SELECT CASE GROUPING (companyId) WHEN 0 THEN (SELECT CFP..Company.companyName FROM Company WHERE Company.companyId = Activity.companyId) ELSE 'TOTAL' END AS [Company name], CASE GROUPING (dateOrder) WHEN 0 THEN (SELECT CAST(dateOrderAS VARCHAR)) ELSE 'SUB TOTAL' END AS [dateOrder], SUM(transactionAmount) AS [Request amount] FROM Activity WHERE DATEPART(year, dateOrder) = DATEPART(year, '2004') GROUP BY companyId, dateOrderWITH ROLLUP
after I've created a new column in a table with the "Create a new column" with custom members. How do I actually remove this newly created column without recreating the dimension ?
i want this keep query output result but don't want the "compute " this command , because this query cannot run in this dos command directc.exe , Thus, it is have any writing skill , it is possible using of rollup ?
How to writing this query using rollup or grouping sets in two way?
data shop time date sku discount% sales qty amount A 13:00pm, 2014-feb-11 apple 30% 5 #20 A 13:00pm, 2014-feb-11 apple 30% 5 #20 A Shop Qty :10 Amt:40 B 23:00pm, 2014-feb-11 apple 30% 5 #20 B 23:00pm, 2014-feb-11 apple 30% 5 #20 B shop Qty :10 Amt $40 Grand total qty:20 , Amt $80
I have been working on this 'Select Count' problem for the past week. Somehow, the Counts were multipled.2 requests showed 4 counts, 3 requests showed 9 counts, 4 requests showed 16 counts. The main question,to the best of my knowledge, is the coding for DBadapter.Fill method. After 'Left Join' 2 tables, how do I code the DataTable names? I have tried using TransDS.Tables("Table name") to solve the problem. Butthe counts still showed mulpile #. Another question: why there are 1 '0' line and 2 'rollup' lines?
4 4 2 0 0 0 strApptsSQL = "SELECT c.LName + ', ' + c.FName AS Examiner, " & _ "COUNT(Case TransCode WHEN 'R' THEN 1 ELSE NULL END) AS Requested, " & _"COUNT(Case TransCode WHEN 'B' THEN 1 ELSE NULL END) AS Scheduled, " & _ "COUNT(Case TransCode WHEN 'F' THEN 1 ELSE NULL END) AS Finished, " & _"COUNT(Case TransCode WHEN 'W' THEN 1 ELSE NULL END) AS DSnoShow, " & _ "COUNT(Case TransCode WHEN 'D' THEN 1 ELSE NULL END) AS Deleted, " & _"COUNT(Case TransCode WHEN 'E' THEN 1 ELSE NULL END) AS Cancelled " & _ "FROM Sssss.dbo.TransHistory AS T " & _"LEFT JOIN Sssss.dbo.Requests AS r ON T.TransUserID = r.RequestStaffIDFK " & " " & _ "LEFT JOIN Employee.dbo.Contacts AS c ON r.RequestStaffIDFK = c.ContactPK " & " " & _"GROUP BY c.LName + ', ' + c.FName WITH ROLLUP " & _ "ORDER BY c.LName + ', ' + c.FName" 'declare and create the data adaptersDim oDAAppts As New OleDbDataAdapter(strApptsSQL, oConnect) Try ' fill the Dataset using the data adaptersoDAAppts.Fill(TransDS, "Requests") Catch oErr As Exception ' display error message in page lblErr.Text &= oErr.Message & "<br />" Finally ' be sure to close connection if error occurs If oConnect.State <> ConnectionState.Closed Then oConnect.Close() End If End Try ' bind DataGrid to tablegvExaminerAppts.DataSource = TransDS.Tables("Requests") gvExaminerAppts.DataBind()
I installed the SQL Server 2005 SP2 update 2 rollup on my 64-bitserver and the performance has tanked!I installed rollup 3 on some of them, but that did not seem to help.I thought it was just a linked server performance issue, but myoptimization started running today on one of the "update 2" instancesand so far it's been running about 10 hours longer than it normallydoes.The rollup 3 fixed our stack dumping issues, but we NEED to have thisperformance thing fixed!I saw that MS has come out with update 4 last week - doesn't sayanything about fixing this, though.Has anyone else experienced this?I'm not necessarily expecting anyone to have a fix for this, justwantto know I'm looking in the right place before I call MS.
Hello all, I´m a beginner on AS2005 (but I know pretty well AS2000), I migrated a cube from AS2000 to AS2005 but in this cube I have a Custom Rollup Formula on two levels of my Time dimension (month and week), an example of the week level formula is the next: iif( [Time].CurrentMember.Name = [Time].CurrentMember.NextMember.Name, null, iif( [Time].CurrentMember.Name = [Time].CurrentMember.PrevMember.Name, Sum({[Time].CurrentMember.Children,[Time].CurrentMember.PrevMember.Children}), Sum([Time].CurrentMember.Children) ) ) <<this formula overrides the week aggregations>>
and I really need this but I cannot find on AS2005 where to do the same thing, someone can tell me where can I define Custom Rollup Formulas and how?. Thanks in advance!
I have a daily report which each morning generates monthly information for the current month which was implemented in December. Everything was working correctly untill January 1st. On the 1st the report generated blank since it was suppose to generate 1-31 Dec but but the currently month was Jan, so it failed. How do I program it so if it is the 1st of a month generates the previous month but still would generate current month but while in the current month? Any help is appreciated.
SELECT GETDATE() - 1 AS rptdate, Errors.WTG_ID, lookup.Phase, Errors.STATUS_TYPE, Errors.STATUS_CODE, STATUS_CODES.STATUS_DEF, Errors.TIME_STAMP, Errors.ANSI_TIME, lookup.WTG_TYPE, Errors.POSITION FROM Errors INNER JOIN lookup ON Errors.WTG_ID = lookup.WTG_id RIGHT OUTER JOIN STATUS_CODES ON Errors.STATUS_CODE = STATUS_CODES.STATUS_CODE AND lookup.WTG_TYPE = STATUS_CODES.WTG_TYPE WHERE (STATUS_CODES.STATUS_DEF IS NOT NULL) AND (Errors.TIME_STAMP BETWEEN DATEADD(mm, DATEDIFF(mm, 0, GETDATE()), 0) AND DATEADD(mm, DATEDIFF(m, 0, GETDATE()) + 1, 0)) ORDER BY Errors.WTG_ID, Errors.TIME_STAMP, position
Any working example of what a ragged hierarchy should look like for the unary and custom rollup calcs to work?
I have a parent-child hierarchy that works as expected but can't manage to get the same with a flattened ragged hierarchy. Parents disappear if any of the children aren't in the fact table (even though the children are set to '~' and the parent has its own custom rollup calc).
Do I need to replicate the unary and measure formula all the way to the end in the same way i do the member name/value (so i can set ignore if same as parent)? Setting unary to null seems to work when the key doesnt exist in the fact table but the default behaviour for null is '+' so i end up getting wrong results if the key does exist!
Repro:
In words
I have an EAV style fact table. The measure name is defined in a 'dim measure' table. Some measures exist in the fact, some are manufactured using Unary ops or custom rollup formulas.
Here's a diagram of the hierarchy
I want to recreate the functionality as a flattened hierarchy (the number of levels is fixed), but can't seem to do it... Here's what I've gotten for the same hierarchy created using the two different approaches
Below are queries to recreate the tables from adventureworksdw2014. The parent child hierarchy is set up the standard way... measureparentkey is parent. set name, unary and formula as expected. Set NonLeafDataHidden for the parent attribute. I've tried various combinations for the ragged hierarchy but none work 100% of the time. I want to have a user defined hierarchy for the performance benefits.
--Fact view CREATE View dbo.FactSales AS select fis.ProductKey , fis.OrderDateKey , 1 AS MeasureKey -- salesAmount , fis.SalesAmount AS MeasureValue
I have a question regarding ROLLUP and how to use the operator.
I've been asked to retrieve a list showing the total repair cost per year displaying Transport Type, Manufacturer and Transport. The query I used is:
SELECT ty.Description AS TransportDescription, t.SerialNumber AS Transport, ty.Manufacturer, SUM (r.RepairCost) AS RepairCost, YEAR(r.EndWorkDate) AS [Year]
[Code] .....
How could I use the rollup function to display subtotals per Transport Type, Manufacturer and Transport?
-- Get the new Customer Identifier, return as OUTPUT param SELECT @NoteID = @@IDENTITY
-- Insert new notes for all the users that the note pertains to, in this case this will be by the assigned -- users. IF @FK_UserIDList IS NOT NULL EXECUTE spInsertNotesByAssignedUsers @NoteID, @FK_UserIDList
-- Insert New Address record -- Retrieve Address reference into @AddressId -- EXEC spInsertForUserNote -- @FK_UserID, --@NoteID, -- @BeenRead -- @Fax, -- @PKId, -- @AddressId OUTPUT
COMMIT TRANSACTION
-------------------------------------------------- GO
ok can someone tell me why i get two different answers for the same query. (looking for last day of month for a given date)
SELECT DATEADD(ms, - 3, DATEADD(mm, DATEDIFF(m, 0, CAST('12/20/2006' AS datetime)) + 1, 0)) AS Expr1 FROM testsupplierSCNCR I am getting the result of 01/01/2007
"Error: 8624, Severity: 16, State: 1 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."
I have traced this to an insert statement that executes as part of a stored procedure.
INSERT INTO ledger (journal__id, account__id,account_recv_info__id,amount)
There is also an auto-increment column called id. There are FK contraints on all of the columns ending in "__id". I have found that if I remove the contraint on account__id the procedure will execute without error. None of the other constraints seem to make a difference. Of course I don't want to remove this key because it is important to the database integrity and should not be causing problems, but apparently it confuses the optimizer.
Also, the strange thing is that I can get the procedure to execute without error when I run it directly through management studio, but I receive the error when executing from .NET code or anything using ODBC (Access).
Hey, i've written a query to search a database dependant on variables chosen by user etc etc. Opened up a new sqldatasource, entered the query shown below and went on to the test query page. Entered some test variables, everything works as it should do. Try to get it to show in a datagrid on a webpage - nothing. No data shows. SELECT dbo.DERIVATIVES.DERIVATIVE_ID, count(*) AS Matches FROM dbo.MAKES INNER JOIN dbo.MODELS ON dbo.MAKES.MAKE_ID = dbo.MODELS.MAKE_ID INNER JOIN dbo.DERIVATIVES ON dbo.MODELS.MODEL_ID = dbo.DERIVATIVES.MODEL_ID INNER JOIN dbo.[VALUES] ON dbo.DERIVATIVES.DERIVATIVE_ID = dbo.[VALUES].DERIVATIVE_ID INNER JOIN dbo.ATTRIBUTES ON dbo.[VALUES].ATTRIBUTE_ID = dbo.ATTRIBUTES.ATTRIBUTE_ID WHERE ((ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID1 and (@VAL1 is null or VALUE = @VAL1)) or (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID2 and (@VAL2 is null or VALUE = @VAL2)) or (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID3 and (@VAL3 is null or VALUE = @VAL3)) or (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID4 and (@VAL4 is null or VALUE = @VAL4)) ) GROUP BY dbo.DERIVATIVES.DERIVATIVE_ID HAVING count(*) >= CASE WHEN @VAL1 IS NOT NULL THEN 1 ELSE 0 END + CASE WHEN @VAL2 IS NOT NULL THEN 1 ELSE 0 END + CASE WHEN @VAL3 IS NOT NULL THEN 1 ELSE 0 END + CASE WHEN @VAL4 IS NOT NULL THEN 1 ELSE 0 END -2 ORDER BY count(*) DESC
Here is the page source
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" Title="Untitled Page" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnectionString1 %>" SelectCommand="	SELECT dbo.DERIVATIVES.DERIVATIVE_ID, count(*) AS Matches 	FROM dbo.MAKES INNER JOIN 				 dbo.MODELS ON dbo.MAKES.MAKE_ID = dbo.MODELS.MAKE_ID INNER JOIN 				 dbo.DERIVATIVES ON dbo.MODELS.MODEL_ID = dbo.DERIVATIVES.MODEL_ID INNER JOIN 				 dbo.[VALUES] ON dbo.DERIVATIVES.DERIVATIVE_ID = dbo.[VALUES].DERIVATIVE_ID INNER JOIN 				 dbo.ATTRIBUTES ON dbo.[VALUES].ATTRIBUTE_ID = dbo.ATTRIBUTES.ATTRIBUTE_ID 	WHERE ((ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID1 and (@VAL1 is null or VALUE = @VAL1)) or 		 (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID2 and (@VAL2 is null or VALUE = @VAL2)) or 		 (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID3 and (@VAL3 is null or VALUE = @VAL3)) or 		 (ATTRIBUTES.ATTRIBUTE_ID = @ATT_ID4 and (@VAL4 is null or VALUE = @VAL4)) ) 	GROUP BY dbo.DERIVATIVES.DERIVATIVE_ID 	HAVING count(*) >= CASE WHEN @VAL1 IS NOT NULL THEN 1 ELSE 0 END + 									 CASE WHEN @VAL2 IS NOT NULL THEN 1 ELSE 0 END + 									 CASE WHEN @VAL3 IS NOT NULL THEN 1 ELSE 0 END + 									 CASE WHEN @VAL4 IS NOT NULL THEN 1 ELSE 0 END -2 	ORDER BY count(*) DESC "> <SelectParameters> <asp:ControlParameter ControlID="DropDownList1" Name="ATT_ID1" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="TextBox1" Name="VAL1" PropertyName="Text" /> <asp:Parameter Name="ATT_ID2" /> <asp:Parameter Name="VAL2" /> <asp:Parameter Name="ATT_ID3" /> <asp:Parameter Name="VAL3" /> <asp:Parameter Name="ATT_ID4" /> <asp:Parameter Name="VAL4" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnectionString1 %>" SelectCommand="SELECT * FROM [ATTRIBUTES]"></asp:SqlDataSource> <br /> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource2" DataTextField="ATTRIBUTE_NAME" DataValueField="ATTRIBUTE_ID"> </asp:DropDownList> <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox><br /> <br /> <br /> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="DERIVATIVE_ID" DataSourceID="SqlDataSource1"> <Columns> <asp:BoundField DataField="DERIVATIVE_ID" HeaderText="DERIVATIVE_ID" InsertVisible="False" ReadOnly="True" SortExpression="DERIVATIVE_ID" /> <asp:BoundField DataField="Matches" HeaderText="Matches" ReadOnly="True" SortExpression="Matches" /> </Columns> </asp:GridView> </asp:Content> AFAIK I have configured the source to pick up the dropdownlist value and the textbox value (the text box is autopostback). Am i not submitting the data correctly? (It worked with a simple query...just not with this one). I have tried a stored procedure which works when testing just not when its live on a webpage. Please help!
(Visual Web Devleoper 2005 Express and SQL Server Management Studio Express)
However, as you can see, the original select query is run twice and joined together.What I was hoping for is this to be done in the original query without the need to duplicate the original query.
I'm trying to find the command to open up an odbc conection inside sql2005 express. I only have ues of an odbc connector, we're conection to remedy. We will eventually be using stored procedures to extract the data we need from remedy and doing additional data crunching. I'm a foxpro programmer so once I get the correct syntax for making the odbc connector I shold be ok. Also I need a really good advanced book on sql2005. The type of book that would have my odbc answer. I've spent all morning trying to find this information and was unable to.
Thanks in advance
Daniel Buchanan.
If this was the wrong forum to post this on, please move this question to the correct one. I need this answer soon.