Viewing 15 posts - 226 through 240 (of 284 total)
A little late to the party, but this is a variation on the cte that was posted earlier by J Livingston SQL. I like the cte because it is so...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 24, 2013 at 6:09 pm
All 3 approaches worked! Awesome forum.
I really liked the Grouping because is was so straightforward. Why didn't I think of grouping! (Duh!)
Of course nothing beats a cte except a cte...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 9, 2013 at 11:23 pm
kit-1143032 (10/8/2013)
I am wondering if anyone has used this in a CTE?
Absolutely! Using Row_Number with a CTE is a great combination.
;with cte as
(
Select *,...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 8, 2013 at 10:21 am
There is a little bit of guessing here.
I need to delete TableA row with ConsumerID = 99 as my condition would be to delete the rows in Table A...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 7, 2013 at 1:08 pm
This gets your original data into the desired format.
Consumable DDL & Insert Statements:
declare @t1 table
(
RunDate date,
FiscalYear int,
PP int,
Port...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 29, 2013 at 9:46 am
sharonsql2013 (9/27/2013)
AnniversaryEndDate. If it falls in that then it should display that else...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 27, 2013 at 2:37 pm
I don't do anything in Reporting Services, so this could be totally off base, but the following works for me:
declare @t1 table
(
Trans_type char,
Credit int,
...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 5:34 pm
Knives85 (9/23/2013)
There an issue around the If. I get the error, expecting ID?
Your ELSE is dangling.
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 4:40 pm
If @type is declared as an INT, I don't believe you need any kind of quotes around the actual numbers you are comparing it to.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 4:28 pm
wolfkillj (9/23/2013)
Thanks for being the one to educate the OP about the need to provide DDL and test data.
What kind of torques my wrench is that the OP posted another...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 10:50 am
wolfkillj (9/23/2013)
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 10:33 am
wolfkillj (9/23/2013)
+1 to LinksUp for providing the DDL and sample data for this question.
However, the solution above requires 3 scans of the @party_payments table (and R. Brush's CTE version...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 9:11 am
perireddy.arikatla (9/23/2013)
I am New to This forms.So I don't know how to Post.
Please don't use that as an excuse. You were told how to post 3 times, twice by myself...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 8:57 am
Is there always a 1 to 1 relationship between Admissions and Members? If so, why 2 tables? Could you move CountOfMembers from members into Admissions?
If you can, then the...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 23, 2013 at 6:26 am
perireddy.arikatla (9/22/2013)
When i Run the query without giving party_code in where clause
i.e
SELECT party_code, sum(inst_amt) as total_insts,
(Select Sum(paid_amt) as total_paid
...
__________________________________________________________________________________________________________
How to Post to get the most: http://www.sqlservercentral.com/articles/Best+Practices/61537/
September 22, 2013 at 8:54 am
Viewing 15 posts - 226 through 240 (of 284 total)