MySQL - Restrict view results by date

I have a view that returns a list of all bus passengers that need to be picked up on a given day (monday - sunday).

When a user is picked up, a record is written to a table named "trip_history". This table contains a date/timestamp for that ride. 2 rides are allowed per day/per rider - the ride to their destination and their ride home.

I want to add functionality to this view to restrict that list to not show riders that have already been recorded in trip_history for the AM and PM trip.

So, if the db view shows 3 riders available for pickup:




If I pick Jim up in the AM, I want the view to:

1. Check if the current system date/time is in the AM (time between 00:00:00 and 11:59:59)

2. Check the "trip_history" table to see if the latest (MAX) date/time for that rider occured between 00:00:00 and 11:59:59 of the current day

If both conditions are true, view should now show the following:



I want to repeat this process for the PM of the same day (time between 12:00:00 and 23:59:59)

The goal is to not allow for two pickups to occur for the same passenger within the morning, and conversely in the evening.

A dump of the tables is attached.

Ferdigheter: Databaseadministrasjon, Databaseprogrammerere, MySQL, PHP, Programvarearkitektur

Se mer: mysql php display results date, mysql query results date range php, view results mysql html, order by current date in mysql, php mysql sort by date, limit in php mysql, mysql order by date format, mysql query to order by date, how limit works in mysql, limit and skip in mysql, mysql limit 1, php, ajax, javascript, jquery / prototype, display mysql database search results google maps, php mysql doesnt view search query, php mysql ajax view image uploaded, mysql loop query results, mysql show query results generic script

Om arbeidsgiveren:
( 76 omtaler ) huntley, Canada

Prosjekt-ID: #16995010

Tildelt til:


Hi Dear, I can complete this job in a hour. I'm an expert in sql(MySQL, SQL Server) for 9+ years. I already thought how to implement this. thank you

$30 USD på 0 dager
(2 omtaler)

15 frilansere byr i snitt $35 for denne jobben


Hello hiring member i am bhavika i have done this types job in my past so i can do it now so please give me chance to serve you thanks in advance :)

$30 USD på 0 dager
(86 Omtaler)

Hi, there i read your initial requirements and i have some question regarding to your RESTRICT VIEW RESULT [login to view URL] can we discuss it on chat ?

$25 USD på 1 dag
(35 Omtaler)

Hello Sir, Hope you are doing great! I read your requirement about need of --------- developer and I want you to know that I have a decent experience in PHP, WordPress, Laravel, javascript, bootstrap, HTML and Mer

$20 USD på 3 dager
(24 Omtaler)

Hi There, I have reviewed your requirements for your project and understood it. We have hands on experience for your project and we want to work long term! You can check our reviews and read about us, we provide sat Mer

$88 USD på 1 dag
(8 Omtaler)

I can do your MySQL task as per the description, please contact to discuss in detail and move further, thanks. Relevant Skills and Experience MySQL

$50 USD på 1 dag
(55 Omtaler)

Dear Sir, I am an independent freelancer having experience of more than 8 years. I am highly experienced in php, html, css, javascript, jQuery, Ajax, Codeigniter, bootstrap etc. I believe the website has been deve Mer

$20 USD på 1 dag
(31 Omtaler)

Hey Sir, I am interested in your project.I am good with MySQL and I can help you with your project and I am ready to start the work right now, and will deliver with good result to you. please send me a message so th Mer

$25 USD på 1 dag
(20 Omtaler)

Dear Sir, I would like to discuss few thing for better understanding of [login to view URL] share details and ping me for further discussion. Spare a moment on our previous work [login to view URL] http://profeenlinea. Mer

$30 USD på 1 dag
(6 Omtaler)

Hi, how are you today? I read your request and I understand the requirement. I can either modify the view or provide a query that will perform the filtering.

$40 USD på 1 dag
(14 Omtaler)

Hi can we discuss and fix it

$35 USD på 3 dager
(7 Omtaler)

A proposal has not yet been provided

$25 USD på 1 dag
(3 Omtaler)

Hi, Hope you will be fine and doing well in your field. I read the job details and sure that I can help you in this task. I have experience in MS SQL Server. Waiting your response to work with professionals Mer

$15 USD på 1 dag
(2 Omtaler)

hello there, I am Raneem and it will be my pleasure to work with you. I have an outstanding experience in both frontend and backend development and a good knowledge of PHP so I can handle any website using this lan Mer

$55 USD på 3 dager
(2 Omtaler)

Hello there. Thank you for your time to view my proposal. I have gone through your job posting and I am very much interested in the job with the requirements you have set. I believe I have the right set of skills Mer

$30 USD på 1 dag
(0 Omtaler)