Reference no: EM132757615
Find out the day of the week for the Latest FlightDate and store it in a variable.
INSERT INTO dbo.Flights (FlightDateTime, FlightDepartureCity, FlightDestinationCity, Ontime)
SELECT '1/1/2012','Dallas-Texas','L.A.',1 UNION
SELECT '1/2/2012','Austin-Texas','New York',1 UNION
SELECT '1/3/2012','Houston-Texas','New Jersy',0 UNION
SELECT '1/4/2012','San Antonio-Texas','Mesquite',1 UNION
SELECT '1/5/2012','Lewisville-Texas','Albany',0 UNION
SELECT '1/6/2012','Orlando-Florida','Atlanta',1 UNION
SELECT '1/7/2012','Chicago-Illinois','Oklahoma City',1 UNION
SELECT '1/8/2012','New Orleans-Louisiana','Memphis',0 UNION
SELECT '1/9/2012','Miami-Florida','Charlotte',1 UNION
SELECT '1/10/2012','Sacramento-California','San Francisco',1