title: Make calculation in SQL select
body: <p>I want to consolidate values in my table using SELECT Query.
  My table has 5 Columns: Name, Date [max three dates (consecutives buisness days)], and three values in each day.</p>
  
  <p>I want an output like: <strong>strName, SUM(Value1 + Value2 - Value3) from Date0, SUM(Value1 + Value2 - Value3) from Date1, SUM(Value1 + Value2 - Value3) from Date2.</strong></p>
  
  <p>Input:</p>
  
  <pre><code>strName myDate  Value1  Value2  Value3
  X4  2012-06-14  26300   0   0
  X4  2012-06-15  0   4000    0
  X4  2012-06-18  0   5600    0
  X9  2012-06-14  764 0   0
  A3  2012-06-14  7850    0   0
  B   2012-06-14  5500    0   0
  C3  2012-06-14  269100  0   0
  D3  2012-06-14  395100  0   0
  D3  2012-06-15  0   0   500
  </code></pre>
  
  <p>Ideal Output:</p>
  
  <pre><code>X4, 26300, 4000,5600
  X9, 760, 0, 0
  A3, 7850
  ...
  D3, 395100, 0, -500
  </code></pre>
  
  <p>My table:</p>
  
  <pre><code>USE [MyTestBD]
  GO
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  SET ANSI_PADDING ON
  GO
  CREATE TABLE [dbo].[tbX](
  [strName] [varchar](max) NOT NULL,
  [Value1] [float] NOT NULL,
  [myDate] [date] NOT NULL,
  [Value2] [float] NOT NULL,
  [Value3] [float] NOT NULL
  ) ON [PRIMARY]
  GO
  SET ANSI_PADDING OFF
  GO
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'X4', 26300, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'X4', 0, CAST(0xCC350B00 AS Date), 4000, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'X4', 0, CAST(0xCF350B00 AS Date), 5600, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'X9', 764, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'A3', 7850, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'B', 5500, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'C3', 269100, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'D3', 395100, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'D3', 0, CAST(0xCC350B00 AS Date), 0, 500)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'D4', 400, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'D4', 0, CAST(0xCC350B00 AS Date), 400, 6600)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'E3', 361349, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'F6', 45500, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'F6', 0, CAST(0xCC350B00 AS Date), 11600, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'G4', 55979, CAST(0xCB350B00 AS Date), 0, 0)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'G4', 0, CAST(0xCC350B00 AS Date), 0, 19100)
  INSERT [dbo].[tbX] ([strName], [Value1], [myDate], [Value2], [Value3]) VALUES (N'G4', 0, CAST(0xCF350B00 AS Date), 0, 38300)
  </code></pre>
  
  <p>PS: I didn't found a nice Title for my question. Feel free to edit it.</p>