Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need Filter Flights by arrival Time

when I click filter and enter for example 12 Am
get all flights that arrive on 12 Am

if u have table for flight with arrival time
e.g : flight number place time
205 London 12 am
708 German 2 Pm
901 Turkey 5 am
1001 Egypt 5 Am
1015 India 2 Pm

I wand to filter by time if I enter 2 pm
show flight German and India

if enter 5 Am
show flight Egypt and Turkey
Posted
Updated 11-Dec-12 14:58pm
v2
Comments
Mehdi Gholam 7-Dec-12 2:41am    
You have to supply more information, as your question is too generic to answer.
bado2015 7-Dec-12 3:19am    
if u have table for flight with arrival time
e.g : flight number place time
205 London 12 am
708 German 2 Pm
901 Turkey 5 am
1001 Egypt 5 Am
1015 India 2 Pm

I wand to filter by time if I enter 2 pm
show flight German and India

if enter 5 Am
show flight Egypt and Turkey
Richard MacCutchan 7-Dec-12 5:14am    
You do not say where you are getting your data from, but it is a simple matter to compare the time of the flight to the time selected by the user, and then only display the ones that match.

1 solution

select * from flightTable where arrivalTime = 'inputarrivaltime' order by flightnumber

select * from flightTable where time = '2012/12/11 14:00:00" order by flightnumber

output
------

708 German 2012/12/11 14:00:00
1015 India 2012/12/11 14:00:00

do include the date too in your query based on your filter.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900