Viewing 15 posts - 166 through 180 (of 541 total)
Eirikur Eiriksson (6/20/2014)
I think the method I used earlier has already been posted on this thread, it is the...
June 23, 2014 at 2:16 am
Eirikur Eiriksson (6/20/2014)
Bear with me here but is this the result you are after?😎
MyLongDesiredRunningTotalSequenceWK NOACCOMPUSD_AMOUNTSOA_TYPE
100.00191620112003100.00Agent
300.002101620412003200.00Freight
450.003111620712003150.00Agent
700.005121620812003250.00Costs
1100.006131622412003400.00Cost
1600.007141629512003500.00Freight
2140.008151629512003540.00Cost
Yes, this is exactly the result I am looking for. Could you please what query you...
June 20, 2014 at 3:45 pm
Sachin Nandanwar (6/20/2014)
CREATE TABLE [dbo].[GL](
[Sequence] [int] NOT NULL,
[WK NO] [int] NULL,
[AC] [nvarchar](10) NULL,
[COMP] [nvarchar](10) NULL,
[USD_AMOUNT] [numeric](16, 2) NULL,
[SOA_TYPE]...
June 20, 2014 at 10:03 am
ChrisM@Work (6/20/2014)
pwalter83 (6/20/2014)
Sachin Nandanwar (6/20/2014)
(SELECT SUM(CASE WHEN SOA_TYPE IN ('Agent','Freight','Cost') or AC = '16208'THEN USD_AMOUNT ELSE 0 END) YourSum ...
June 20, 2014 at 9:24 am
Sachin Nandanwar (6/20/2014)
(SELECT SUM(CASE WHEN SOA_TYPE IN ('Agent','Freight','Cost') or AC = '16208'THEN USD_AMOUNT ELSE 0 END) YourSum
FROM GL...
June 20, 2014 at 7:05 am
Sachin Nandanwar (6/20/2014)
Yes that's right..
Could you please suggest another way to do a running total in SQL 2008 R2 then ?
Thanks.
June 20, 2014 at 6:40 am
Sachin Nandanwar (6/20/2014)
Quote strange.Can you post the entire query.
Please find the query attached.
Thanks.
June 20, 2014 at 4:31 am
Sachin Nandanwar (6/20/2014)
Is this SQL 2005 and above ?EDIT: Whats the compatibility of the database ?
Thanks.
Yes, its SQL 2008 R2. The compatibility level is SQL Server 2008 (100).
June 20, 2014 at 4:12 am
Sachin Nandanwar (6/19/2014)
SELECT SUM(YourSum) FROM
(
SELECT SUM(CASE WHEN SOA_TYPE = 'Agent' THEN USD_AMOUNT ELSE 0 END) +
SUM(CASE WHEN SOA_TYPE = 'Freight' THEN USD_AMOUNT ELSE 0 END) +
SUM(CASE...
June 19, 2014 at 9:18 am
GilaMonster (2/27/2014)
SELECT Booking_ID FROM dbo.BOOKING AS b
WHERE DG_FLG != 'Y' AND
NOT EXISTS (SELECT 1...
February 27, 2014 at 6:24 am
GilaMonster (2/27/2014)
pwalter83 (2/27/2014)
What I wish to achieve is no rows should be displayed where DG_FLG = 'Y' and OOG_FLG = 'Y'.
Which wasn't what you said in your initial post.
What...
February 27, 2014 at 6:07 am
GilaMonster (2/27/2014)
WHERE NOT EXISTS (SELECT 1 FROM <Table Name> ib WHERE ib.Booking_ID = <outer table reference>.Booking_ID AND Flag = 'Y')
If you...
February 27, 2014 at 5:23 am
djj (1/28/2014)
How do you handle the fact that Saturday and Sunday do not have a place in the Staff table?
That was my question if you read it properly. Resolved it...
January 28, 2014 at 9:00 am
Viewing 15 posts - 166 through 180 (of 541 total)