MySQL Forums
Forum List  »  Newbie

Returning TIME when number field reaches Zero
Posted by: Mike Swift
Date: September 19, 2020 08:10AM

I have a competition web with a MySQL db with these three fields (amongst others)

"Date_competition_started" (Date input manually from web form when we start a competition)
"Number_of_tickets_allocated" (number allocated manually from the same web form)
"Date_Competition_won" (Date populated automatically when we have chosen the winner)

At the moment I have php webpage with
TABLE1 which shows two dates:   
"Date_competition_started"  &  "Date_Competition_won" 
But 
I want to show  TABLE2 to show:  
"Date_competition_started"  &  THE DATE RETURNED when   "Number_of_tickets_allocated" reaches zero.

This will give us the exact date and time the last ticket was sold as opposed to the date we choose the winner (which could be days after the last ticket sold)

So how would I get the database to return date and time the number of tickets in  "Number_of_tickets_allocated"  reaches zero and how would I present this time stamp in TABLE2. 

Also could I present the length of time it took a competition to sell out of tickets , So The time between "Date_competition_started"  &  THE DATE RETURNED when   "Number_of_tickets_allocated" reaches zero.

Hope that makes sense i've tried to explain the best I can. I am a complete noob, sorry

Options: ReplyQuote


Subject
Written By
Posted
Returning TIME when number field reaches Zero
September 19, 2020 08:10AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.