SQLTeam.com | Weblogs | Forums

Select query to check how many times stock price 10 dollars dropped or bounced

i have the following columns in table historical_data holding stock daily share price, how to check within 7 ,10 , 15, 20 or 30 days.
how many dollars went low or bounced high.

select Date, Open, High, Low, Close from historical_data

want to check it ever dropped 10 dollars in 30 days at all, based on date value.

thank you very much for the helpful info.

Please provide sample data

Hello I am sorry, here is the sample table script, this is example msft table name:
CREATE TABLE [dbo].[MSFT](
[Date] [datetime] NULL,
[Open] [float] NULL,
[High] [float] NULL,
[Low] [float] NULL,
[Close] [float] NULL,
[AdjClose] [float] NULL,
[Volume] [float] NULL
) ON [PRIMARY]

GO

using date , high and low of the day, I would like to see how to get details, when the stock fell or raised 10 dollars with in any 30 days..

here please all inserts into table msft.
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A91F00000000 AS DateTime), 105.400002, 105.82, 104.519997, 104.910004, 103.233643, 21786900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92000000000 AS DateTime), 104.610001, 106.5, 104.32, 105.949997, 104.257019, 25901700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92100000000 AS DateTime), 105.940002, 106.050003, 104.720001, 105.120003, 103.440285, 29493900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92200000000 AS DateTime), 104.93, 105.309998, 103.889999, 104.400002, 102.731789, 40171600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92300000000 AS DateTime), 108.080002, 108.199997, 106.080002, 106.269997, 104.571907, 56004000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92600000000 AS DateTime), 106.300003, 108.139999, 106.129997, 107.970001, 106.244736, 29707000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92700000000 AS DateTime), 108.57, 108.82, 107.260002, 107.660004, 105.939697, 26316600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92800000000 AS DateTime), 107.959999, 111.150002, 107.599998, 110.830002, 109.059044, 30702100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92900000000 AS DateTime), 110.739998, 111, 109.5, 109.620003, 107.868378, 31372100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92A00000000 AS DateTime), 110.18, 110.18, 106.139999, 107.68, 105.959373, 37005300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92D00000000 AS DateTime), 107.190002, 107.529999, 104.760002, 105.370003, 103.686295, 34668300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92E00000000 AS DateTime), 106.489998, 106.720001, 105.379997, 106.080002, 104.384949, 27655200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92F00000000 AS DateTime), 106.029999, 106.449997, 105.419998, 106.279999, 104.581749, 23628700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93000000000 AS DateTime), 105.400002, 108.089996, 104.839996, 107.57, 105.851128, 26104300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93100000000 AS DateTime), 107.800003, 108.050003, 106.82, 108.040001, 106.313622, 18659600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93400000000 AS DateTime), 108.120003, 108.419998, 107.559998, 108.129997, 106.402191, 20265900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93500000000 AS DateTime), 108.559998, 109.099998, 108.169998, 108.879997, 107.140198, 16080200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93600000000 AS DateTime), 109.330002, 109.75, 108.760002, 109.489998, 107.740456, 15487500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93700000000 AS DateTime), 109.709999, 110.160004, 109.599998, 109.669998, 107.91758, 13677200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93800000000 AS DateTime), 109.419998, 109.690002, 108.379997, 109, 107.258286, 18183700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93B00000000 AS DateTime), 109.239998, 109.580002, 108.099998, 108.209999, 106.480911, 18472500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93C00000000 AS DateTime), 108.559998, 109.75, 108.040001, 109.559998, 107.809334, 16788300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93D00000000 AS DateTime), 108.489998, 108.989998, 106.82, 107.660004, 106.347382, 29982800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93E00000000 AS DateTime), 108.300003, 108.860001, 107.300003, 107.639999, 106.327629, 21384300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93F00000000 AS DateTime), 107.360001, 107.900002, 106.690002, 107.580002, 106.268364, 18061500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94200000000 AS DateTime), 107.510002, 107.900002, 106.480003, 106.870003, 105.567017, 17914200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94300000000 AS DateTime), 106.919998, 107.349998, 105.849998, 105.980003, 104.687874, 22881900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94400000000 AS DateTime), 105.849998, 107.339996, 105.779999, 107.059998, 105.754692, 18000600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94500000000 AS DateTime), 107.150002, 108.18, 106.870003, 107.559998, 106.248596, 18167700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94600000000 AS DateTime), 107.669998, 108.559998, 107.559998, 108.400002, 107.078369, 17234000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94900000000 AS DateTime), 109.269997, 109.639999, 108.510002, 109.599998, 108.263733, 19662300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94A00000000 AS DateTime), 109.940002, 110.5, 109.790001, 110.260002, 108.91568, 19151500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94B00000000 AS DateTime), 110.449997, 112.029999, 110.269997, 112.019997, 110.654228, 20818000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94C00000000 AS DateTime), 111.669998, 112.610001, 111.440002, 111.949997, 110.585075, 22798700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94D00000000 AS DateTime), 111.690002, 112.779999, 111.519997, 112.330002, 110.960449, 23222700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95100000000 AS DateTime), 110.849998, 111.959999, 110.220001, 111.709999, 110.348, 22634600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95200000000 AS DateTime), 111.010002, 111.419998, 108.099998, 108.489998, 107.167267, 32872400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95300000000 AS DateTime), 108.25, 108.989998, 107.510002, 108.739998, 107.414215, 23477600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95400000000 AS DateTime), 108.230003, 108.720001, 107.230003, 108.209999, 106.890678, 22498600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95700000000 AS DateTime), 108.839996, 109.639999, 108.360001, 109.379997, 108.04641, 20727900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95800000000 AS DateTime), 108.900002, 111.589996, 108.889999, 111.239998, 109.883736, 24301800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95900000000 AS DateTime), 111.43, 111.849998, 110.510002, 111.709999, 110.348, 18891100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95A00000000 AS DateTime), 112.120003, 113.730003, 112.120003, 112.910004, 111.533379, 26055600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95B00000000 AS DateTime), 113.360001, 113.730003, 112.440002, 113.370003, 111.987762, 19122300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95E00000000 AS DateTime), 113.690002, 113.699997, 111.860001, 112.139999, 110.772758, 20736500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95F00000000 AS DateTime), 112.190002, 113.699997, 111.720001, 113.209999, 111.829712, 22170900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96000000000 AS DateTime), 113.050003, 113.32, 111.040001, 111.699997, 110.33812, 21728400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96100000000 AS DateTime), 112.279999, 113.800003, 111.93, 113.57, 112.185326, 23714500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96200000000 AS DateTime), 114, 115.290001, 113.510002, 114.260002, 112.866913, 71229700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96500000000 AS DateTime), 113.029999, 114.900002, 112.220001, 114.669998, 113.271919, 27334500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96600000000 AS DateTime), 114.800003, 115.099998, 113.75, 114.449997, 113.054596, 22668000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96700000000 AS DateTime), 114.470001, 115.059998, 113.739998, 113.980003, 112.590332, 19352000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96800000000 AS DateTime), 114.779999, 114.910004, 114.199997, 114.410004, 113.015083, 19091300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96900000000 AS DateTime), 114.190002, 114.57, 113.68, 114.370003, 112.975578, 21647800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96C00000000 AS DateTime), 114.75, 115.68, 114.730003, 115.610001, 114.200455, 18883100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96D00000000 AS DateTime), 115.300003, 115.839996, 114.440002, 115.150002, 113.746071, 20787200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96E00000000 AS DateTime), 115.419998, 116.18, 114.93, 115.169998, 113.765816, 16648000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96F00000000 AS DateTime), 114.610001, 114.760002, 111.629997, 112.790001, 111.414833, 34821700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97000000000 AS DateTime), 112.629997, 113.169998, 110.639999, 112.129997, 110.762886, 29068900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97300000000 AS DateTime), 111.660004, 112.029999, 109.339996, 110.849998, 109.498489, 29640600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97400000000 AS DateTime), 111.139999, 113.080002, 110.800003, 112.260002, 110.891296, 26198600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97500000000 AS DateTime), 111.239998, 111.5, 105.790001, 106.160004, 104.865669, 61376300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97600000000 AS DateTime), 105.349998, 108.93, 104.199997, 105.910004, 104.618721, 63904300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97700000000 AS DateTime), 109.010002, 111.239998, 107.120003, 109.57, 108.234093, 47742100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97A00000000 AS DateTime), 108.910004, 109.480003, 106.949997, 107.599998, 106.288116, 32068100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97B00000000 AS DateTime), 109.540001, 111.410004, 108.949997, 111, 109.646667, 31610200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97C00000000 AS DateTime), 111.68, 111.809998, 109.550003, 110.709999, 109.360199, 26548200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97D00000000 AS DateTime), 110.099998, 110.529999, 107.830002, 108.5, 107.177139, 32506200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97E00000000 AS DateTime), 108.93, 110.860001, 108.209999, 108.660004, 107.33519, 32785500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98100000000 AS DateTime), 109.32, 110.540001, 108.239998, 109.629997, 108.293358, 26545600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98200000000 AS DateTime), 107.769997, 108.970001, 105.110001, 108.099998, 106.782021, 43770400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98300000000 AS DateTime), 108.410004, 108.489998, 101.589996, 102.32, 101.072495, 63897800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98400000000 AS DateTime), 106.550003, 109.269997, 106.150002, 108.300003, 106.979584, 61646800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98500000000 AS DateTime), 105.690002, 108.75, 104.760002, 106.959999, 105.655914, 55523100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98800000000 AS DateTime), 108.110001, 108.699997, 101.629997, 103.849998, 102.583832, 55162000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98900000000 AS DateTime), 103.660004, 104.379997, 100.110001, 103.730003, 102.465309, 65350900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98A00000000 AS DateTime), 105.440002, 108.139999, 105.389999, 106.809998, 105.507744, 51062400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98B00000000 AS DateTime), 107.050003, 107.32, 105.529999, 105.919998, 104.628593, 33384200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98C00000000 AS DateTime), 106.480003, 107.32, 104.980003, 106.160004, 104.865669, 37680200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98F00000000 AS DateTime), 106.370003, 107.739998, 105.900002, 107.510002, 106.199211, 27922100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99000000000 AS DateTime), 107.379997, 108.839996, 106.279999, 107.720001, 106.406654, 24340200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99100000000 AS DateTime), 109.440002, 112.239998, 109.400002, 111.959999, 110.594955, 37901700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99200000000 AS DateTime), 111.800003, 112.209999, 110.910004, 111.75, 110.38752, 25644100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99300000000 AS DateTime), 110.849998, 111.449997, 108.760002, 109.57, 108.234093, 32039200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99600000000 AS DateTime), 109.419998, 109.959999, 106.099998, 106.870003, 105.567017, 33621800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99700000000 AS DateTime), 107.550003, 108.739998, 106.639999, 106.940002, 105.636162, 35374600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99800000000 AS DateTime), 108.099998, 108.260002, 104.470001, 104.970001, 104.13813, 39495100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99900000000 AS DateTime), 104.989998, 107.800003, 103.910004, 107.279999, 106.429817, 38505200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99A00000000 AS DateTime), 107.080002, 108.879997, 106.800003, 108.290001, 107.431816, 33502100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99D00000000 AS DateTime), 108.269997, 108.559998, 103.550003, 104.620003, 103.790909, 44773900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99E00000000 AS DateTime), 101.800003, 102.970001, 99.349998, 101.709999, 100.903961, 64052500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99F00000000 AS DateTime), 103.599998, 104.43, 102.239998, 103.110001, 102.29287, 28130600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A100000000 AS DateTime), 102.169998, 103.809998, 102, 103.07, 102.253189, 13823100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A400000000 AS DateTime), 104.790001, 106.629997, 104.580002, 106.470001, 105.626244, 32336200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A500000000 AS DateTime), 106.269997, 107.330002, 105.360001, 107.139999, 106.290932, 29124500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A600000000 AS DateTime), 107.889999, 111.330002, 107.860001, 111.120003, 110.239395, 46788500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A700000000 AS DateTime), 110.330002, 111.120003, 109.029999, 110.190002, 109.316765, 28123200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A800000000 AS DateTime), 110.699997, 110.970001, 109.360001, 110.889999, 110.011215, 33665600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AB00000000 AS DateTime), 113, 113.419998, 110.730003, 112.089996, 111.201698, 34732800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AC00000000 AS DateTime), 111.940002, 112.639999, 108.209999, 108.519997, 107.659996, 45197000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AE00000000 AS DateTime), 105.82, 109.239998, 105, 109.190002, 108.324692, 49107400)
GO
print 'Processed 100 total records'
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AF00000000 AS DateTime), 108.379997, 109.449997, 104.300003, 104.82, 103.989311, 45044900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B200000000 AS DateTime), 104.800003, 107.980003, 103.889999, 107.589996, 106.737358, 40801500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B300000000 AS DateTime), 109.800003, 110.949997, 107.440002, 108.589996, 107.729439, 42381900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B400000000 AS DateTime), 110.889999, 111.269997, 109.040001, 109.080002, 108.215561, 36183000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B500000000 AS DateTime), 109.580002, 110.870003, 108.629997, 109.449997, 108.582626, 31333400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B600000000 AS DateTime), 108.25, 109.260002, 105.5, 106.029999, 105.189728, 47043100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B900000000 AS DateTime), 105.410004, 105.800003, 101.709999, 102.889999, 102.074608, 56957300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BA00000000 AS DateTime), 103.75, 104.510002, 102.519997, 103.970001, 103.146057, 49319200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BB00000000 AS DateTime), 103.650002, 106.879997, 101.349998, 103.690002, 102.868271, 68198200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BC00000000 AS DateTime), 103.050003, 104.309998, 98.779999, 101.510002, 100.705551, 70334200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BD00000000 AS DateTime), 101.629997, 103, 97.459999, 98.230003, 97.451546, 111242100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C000000000 AS DateTime), 97.68, 97.970001, 93.980003, 94.129997, 93.384033, 43935200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C200000000 AS DateTime), 95.139999, 100.690002, 93.959999, 100.559998, 99.763077, 51634800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C300000000 AS DateTime), 99.300003, 101.190002, 96.400002, 101.18, 100.378166, 49498500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C400000000 AS DateTime), 102.089996, 102.410004, 99.519997, 100.389999, 99.594429, 38196300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C700000000 AS DateTime), 101.290001, 102.400002, 100.440002, 101.57, 100.765076, 33173800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C900000000 AS DateTime), 99.550003, 101.75, 98.940002, 101.120003, 100.318642, 35329300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CA00000000 AS DateTime), 100.099998, 100.190002, 97.199997, 97.400002, 96.62812, 42579100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CB00000000 AS DateTime), 99.720001, 102.510002, 98.93, 101.93, 101.122223, 44060600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CE00000000 AS DateTime), 101.639999, 103.269997, 100.980003, 102.059998, 101.25119, 35656100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CF00000000 AS DateTime), 103.040001, 103.970001, 101.709999, 102.800003, 101.985329, 31514400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9D000000000 AS DateTime), 103.860001, 104.879997, 103.239998, 104.269997, 103.443672, 32280800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9D100000000 AS DateTime), 103.220001, 103.75, 102.379997, 103.599998, 102.778984, 30067600)

hi

I am trying to do this
please help me understand
your comment
want to check it ever dropped 10 dollars in 30 days at all, based on date value.
in terms of columns … open , high , low , close

drop create data
drop table msft 
go 

create table msft
(
[Date] [datetime] NULL,
[Open] [float] NULL,
[High] [float] NULL,
[Low] [float] NULL,
[Close] [float] NULL,
[AdjClose] [float] NULL,
[Volume] [float] NULL
)
go 

INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A91F00000000 AS DateTime), 105.400002, 105.82, 104.519997, 104.910004, 103.233643, 21786900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92000000000 AS DateTime), 104.610001, 106.5, 104.32, 105.949997, 104.257019, 25901700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92100000000 AS DateTime), 105.940002, 106.050003, 104.720001, 105.120003, 103.440285, 29493900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92200000000 AS DateTime), 104.93, 105.309998, 103.889999, 104.400002, 102.731789, 40171600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92300000000 AS DateTime), 108.080002, 108.199997, 106.080002, 106.269997, 104.571907, 56004000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92600000000 AS DateTime), 106.300003, 108.139999, 106.129997, 107.970001, 106.244736, 29707000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92700000000 AS DateTime), 108.57, 108.82, 107.260002, 107.660004, 105.939697, 26316600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92800000000 AS DateTime), 107.959999, 111.150002, 107.599998, 110.830002, 109.059044, 30702100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92900000000 AS DateTime), 110.739998, 111, 109.5, 109.620003, 107.868378, 31372100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92A00000000 AS DateTime), 110.18, 110.18, 106.139999, 107.68, 105.959373, 37005300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92D00000000 AS DateTime), 107.190002, 107.529999, 104.760002, 105.370003, 103.686295, 34668300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92E00000000 AS DateTime), 106.489998, 106.720001, 105.379997, 106.080002, 104.384949, 27655200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A92F00000000 AS DateTime), 106.029999, 106.449997, 105.419998, 106.279999, 104.581749, 23628700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93000000000 AS DateTime), 105.400002, 108.089996, 104.839996, 107.57, 105.851128, 26104300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93100000000 AS DateTime), 107.800003, 108.050003, 106.82, 108.040001, 106.313622, 18659600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93400000000 AS DateTime), 108.120003, 108.419998, 107.559998, 108.129997, 106.402191, 20265900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93500000000 AS DateTime), 108.559998, 109.099998, 108.169998, 108.879997, 107.140198, 16080200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93600000000 AS DateTime), 109.330002, 109.75, 108.760002, 109.489998, 107.740456, 15487500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93700000000 AS DateTime), 109.709999, 110.160004, 109.599998, 109.669998, 107.91758, 13677200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93800000000 AS DateTime), 109.419998, 109.690002, 108.379997, 109, 107.258286, 18183700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93B00000000 AS DateTime), 109.239998, 109.580002, 108.099998, 108.209999, 106.480911, 18472500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93C00000000 AS DateTime), 108.559998, 109.75, 108.040001, 109.559998, 107.809334, 16788300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93D00000000 AS DateTime), 108.489998, 108.989998, 106.82, 107.660004, 106.347382, 29982800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93E00000000 AS DateTime), 108.300003, 108.860001, 107.300003, 107.639999, 106.327629, 21384300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A93F00000000 AS DateTime), 107.360001, 107.900002, 106.690002, 107.580002, 106.268364, 18061500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94200000000 AS DateTime), 107.510002, 107.900002, 106.480003, 106.870003, 105.567017, 17914200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94300000000 AS DateTime), 106.919998, 107.349998, 105.849998, 105.980003, 104.687874, 22881900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94400000000 AS DateTime), 105.849998, 107.339996, 105.779999, 107.059998, 105.754692, 18000600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94500000000 AS DateTime), 107.150002, 108.18, 106.870003, 107.559998, 106.248596, 18167700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94600000000 AS DateTime), 107.669998, 108.559998, 107.559998, 108.400002, 107.078369, 17234000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94900000000 AS DateTime), 109.269997, 109.639999, 108.510002, 109.599998, 108.263733, 19662300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94A00000000 AS DateTime), 109.940002, 110.5, 109.790001, 110.260002, 108.91568, 19151500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94B00000000 AS DateTime), 110.449997, 112.029999, 110.269997, 112.019997, 110.654228, 20818000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94C00000000 AS DateTime), 111.669998, 112.610001, 111.440002, 111.949997, 110.585075, 22798700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A94D00000000 AS DateTime), 111.690002, 112.779999, 111.519997, 112.330002, 110.960449, 23222700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95100000000 AS DateTime), 110.849998, 111.959999, 110.220001, 111.709999, 110.348, 22634600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95200000000 AS DateTime), 111.010002, 111.419998, 108.099998, 108.489998, 107.167267, 32872400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95300000000 AS DateTime), 108.25, 108.989998, 107.510002, 108.739998, 107.414215, 23477600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95400000000 AS DateTime), 108.230003, 108.720001, 107.230003, 108.209999, 106.890678, 22498600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95700000000 AS DateTime), 108.839996, 109.639999, 108.360001, 109.379997, 108.04641, 20727900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95800000000 AS DateTime), 108.900002, 111.589996, 108.889999, 111.239998, 109.883736, 24301800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95900000000 AS DateTime), 111.43, 111.849998, 110.510002, 111.709999, 110.348, 18891100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95A00000000 AS DateTime), 112.120003, 113.730003, 112.120003, 112.910004, 111.533379, 26055600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95B00000000 AS DateTime), 113.360001, 113.730003, 112.440002, 113.370003, 111.987762, 19122300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95E00000000 AS DateTime), 113.690002, 113.699997, 111.860001, 112.139999, 110.772758, 20736500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A95F00000000 AS DateTime), 112.190002, 113.699997, 111.720001, 113.209999, 111.829712, 22170900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96000000000 AS DateTime), 113.050003, 113.32, 111.040001, 111.699997, 110.33812, 21728400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96100000000 AS DateTime), 112.279999, 113.800003, 111.93, 113.57, 112.185326, 23714500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96200000000 AS DateTime), 114, 115.290001, 113.510002, 114.260002, 112.866913, 71229700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96500000000 AS DateTime), 113.029999, 114.900002, 112.220001, 114.669998, 113.271919, 27334500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96600000000 AS DateTime), 114.800003, 115.099998, 113.75, 114.449997, 113.054596, 22668000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96700000000 AS DateTime), 114.470001, 115.059998, 113.739998, 113.980003, 112.590332, 19352000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96800000000 AS DateTime), 114.779999, 114.910004, 114.199997, 114.410004, 113.015083, 19091300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96900000000 AS DateTime), 114.190002, 114.57, 113.68, 114.370003, 112.975578, 21647800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96C00000000 AS DateTime), 114.75, 115.68, 114.730003, 115.610001, 114.200455, 18883100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96D00000000 AS DateTime), 115.300003, 115.839996, 114.440002, 115.150002, 113.746071, 20787200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96E00000000 AS DateTime), 115.419998, 116.18, 114.93, 115.169998, 113.765816, 16648000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A96F00000000 AS DateTime), 114.610001, 114.760002, 111.629997, 112.790001, 111.414833, 34821700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97000000000 AS DateTime), 112.629997, 113.169998, 110.639999, 112.129997, 110.762886, 29068900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97300000000 AS DateTime), 111.660004, 112.029999, 109.339996, 110.849998, 109.498489, 29640600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97400000000 AS DateTime), 111.139999, 113.080002, 110.800003, 112.260002, 110.891296, 26198600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97500000000 AS DateTime), 111.239998, 111.5, 105.790001, 106.160004, 104.865669, 61376300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97600000000 AS DateTime), 105.349998, 108.93, 104.199997, 105.910004, 104.618721, 63904300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97700000000 AS DateTime), 109.010002, 111.239998, 107.120003, 109.57, 108.234093, 47742100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97A00000000 AS DateTime), 108.910004, 109.480003, 106.949997, 107.599998, 106.288116, 32068100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97B00000000 AS DateTime), 109.540001, 111.410004, 108.949997, 111, 109.646667, 31610200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97C00000000 AS DateTime), 111.68, 111.809998, 109.550003, 110.709999, 109.360199, 26548200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97D00000000 AS DateTime), 110.099998, 110.529999, 107.830002, 108.5, 107.177139, 32506200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A97E00000000 AS DateTime), 108.93, 110.860001, 108.209999, 108.660004, 107.33519, 32785500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98100000000 AS DateTime), 109.32, 110.540001, 108.239998, 109.629997, 108.293358, 26545600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98200000000 AS DateTime), 107.769997, 108.970001, 105.110001, 108.099998, 106.782021, 43770400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98300000000 AS DateTime), 108.410004, 108.489998, 101.589996, 102.32, 101.072495, 63897800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98400000000 AS DateTime), 106.550003, 109.269997, 106.150002, 108.300003, 106.979584, 61646800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98500000000 AS DateTime), 105.690002, 108.75, 104.760002, 106.959999, 105.655914, 55523100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98800000000 AS DateTime), 108.110001, 108.699997, 101.629997, 103.849998, 102.583832, 55162000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98900000000 AS DateTime), 103.660004, 104.379997, 100.110001, 103.730003, 102.465309, 65350900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98A00000000 AS DateTime), 105.440002, 108.139999, 105.389999, 106.809998, 105.507744, 51062400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98B00000000 AS DateTime), 107.050003, 107.32, 105.529999, 105.919998, 104.628593, 33384200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98C00000000 AS DateTime), 106.480003, 107.32, 104.980003, 106.160004, 104.865669, 37680200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A98F00000000 AS DateTime), 106.370003, 107.739998, 105.900002, 107.510002, 106.199211, 27922100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99000000000 AS DateTime), 107.379997, 108.839996, 106.279999, 107.720001, 106.406654, 24340200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99100000000 AS DateTime), 109.440002, 112.239998, 109.400002, 111.959999, 110.594955, 37901700)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99200000000 AS DateTime), 111.800003, 112.209999, 110.910004, 111.75, 110.38752, 25644100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99300000000 AS DateTime), 110.849998, 111.449997, 108.760002, 109.57, 108.234093, 32039200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99600000000 AS DateTime), 109.419998, 109.959999, 106.099998, 106.870003, 105.567017, 33621800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99700000000 AS DateTime), 107.550003, 108.739998, 106.639999, 106.940002, 105.636162, 35374600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99800000000 AS DateTime), 108.099998, 108.260002, 104.470001, 104.970001, 104.13813, 39495100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99900000000 AS DateTime), 104.989998, 107.800003, 103.910004, 107.279999, 106.429817, 38505200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99A00000000 AS DateTime), 107.080002, 108.879997, 106.800003, 108.290001, 107.431816, 33502100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99D00000000 AS DateTime), 108.269997, 108.559998, 103.550003, 104.620003, 103.790909, 44773900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99E00000000 AS DateTime), 101.800003, 102.970001, 99.349998, 101.709999, 100.903961, 64052500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A99F00000000 AS DateTime), 103.599998, 104.43, 102.239998, 103.110001, 102.29287, 28130600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A100000000 AS DateTime), 102.169998, 103.809998, 102, 103.07, 102.253189, 13823100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A400000000 AS DateTime), 104.790001, 106.629997, 104.580002, 106.470001, 105.626244, 32336200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A500000000 AS DateTime), 106.269997, 107.330002, 105.360001, 107.139999, 106.290932, 29124500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A600000000 AS DateTime), 107.889999, 111.330002, 107.860001, 111.120003, 110.239395, 46788500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A700000000 AS DateTime), 110.330002, 111.120003, 109.029999, 110.190002, 109.316765, 28123200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9A800000000 AS DateTime), 110.699997, 110.970001, 109.360001, 110.889999, 110.011215, 33665600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AB00000000 AS DateTime), 113, 113.419998, 110.730003, 112.089996, 111.201698, 34732800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AC00000000 AS DateTime), 111.940002, 112.639999, 108.209999, 108.519997, 107.659996, 45197000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AE00000000 AS DateTime), 105.82, 109.239998, 105, 109.190002, 108.324692, 49107400)
GO

INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9AF00000000 AS DateTime), 108.379997, 109.449997, 104.300003, 104.82, 103.989311, 45044900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B200000000 AS DateTime), 104.800003, 107.980003, 103.889999, 107.589996, 106.737358, 40801500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B300000000 AS DateTime), 109.800003, 110.949997, 107.440002, 108.589996, 107.729439, 42381900)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B400000000 AS DateTime), 110.889999, 111.269997, 109.040001, 109.080002, 108.215561, 36183000)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B500000000 AS DateTime), 109.580002, 110.870003, 108.629997, 109.449997, 108.582626, 31333400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B600000000 AS DateTime), 108.25, 109.260002, 105.5, 106.029999, 105.189728, 47043100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9B900000000 AS DateTime), 105.410004, 105.800003, 101.709999, 102.889999, 102.074608, 56957300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BA00000000 AS DateTime), 103.75, 104.510002, 102.519997, 103.970001, 103.146057, 49319200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BB00000000 AS DateTime), 103.650002, 106.879997, 101.349998, 103.690002, 102.868271, 68198200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BC00000000 AS DateTime), 103.050003, 104.309998, 98.779999, 101.510002, 100.705551, 70334200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9BD00000000 AS DateTime), 101.629997, 103, 97.459999, 98.230003, 97.451546, 111242100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C000000000 AS DateTime), 97.68, 97.970001, 93.980003, 94.129997, 93.384033, 43935200)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C200000000 AS DateTime), 95.139999, 100.690002, 93.959999, 100.559998, 99.763077, 51634800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C300000000 AS DateTime), 99.300003, 101.190002, 96.400002, 101.18, 100.378166, 49498500)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C400000000 AS DateTime), 102.089996, 102.410004, 99.519997, 100.389999, 99.594429, 38196300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C700000000 AS DateTime), 101.290001, 102.400002, 100.440002, 101.57, 100.765076, 33173800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9C900000000 AS DateTime), 99.550003, 101.75, 98.940002, 101.120003, 100.318642, 35329300)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CA00000000 AS DateTime), 100.099998, 100.190002, 97.199997, 97.400002, 96.62812, 42579100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CB00000000 AS DateTime), 99.720001, 102.510002, 98.93, 101.93, 101.122223, 44060600)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CE00000000 AS DateTime), 101.639999, 103.269997, 100.980003, 102.059998, 101.25119, 35656100)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9CF00000000 AS DateTime), 103.040001, 103.970001, 101.709999, 102.800003, 101.985329, 31514400)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9D000000000 AS DateTime), 103.860001, 104.879997, 103.239998, 104.269997, 103.443672, 32280800)
INSERT [dbo].[MSFT] ([Date], [Open], [High], [Low], [Close], [AdjClose], [Volume]) VALUES (CAST(0x0000A9D100000000 AS DateTime), 103.220001, 103.75, 102.379997, 103.599998, 102.778984, 30067600)

select * from msft 
go

thanks
:slight_smile:
:slight_smile: