Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
457 B
3
Indexable
Never
DECLARE @DepartureCity VARCHAR(50) = 'YourDepartureCity';
DECLARE @ArrivalCity VARCHAR(50) = 'YourArrivalCity';

SELECT
    DATEADD(DAY, 1, GETDATE()) AS Date,
    CONVERT(VARCHAR(5), flight_time, 108) AS Time,
    flight_number AS Flight
FROM
    flights_table
WHERE
    departure_city = @DepartureCity
    AND arrival_city = @ArrivalCity
    AND flight_date BETWEEN DATEADD(DAY, 1, GETDATE()) AND DATEADD(DAY, 20, GETDATE())
ORDER BY
    flight_date ASC;