forked from rho_n/hpr_generator
		
	Bug fix of query to find days to next free slot
templates/queries-index-mysql.tpl.html,
templates/queries-index-sqlite.tpl.html:
    Rather than driving the search from the eps table itself, this
    version makes a counter that generates slot numbers from the current
    show number to the highest show number in the system. The counter is
    used to interrogate the eps table to find the first empty slot. This
    sems to be a more reliable approach (but time will tell).
			
			
This commit is contained in:
		| @@ -20,8 +20,8 @@ | ||||
| 	WHERE e.id IS NULL | ||||
|     ) | ||||
|     SELECT | ||||
| 	fe.id as empty_slot, | ||||
| 	(SELECT date(eps.date,\'+1 day\') from eps where id = fe.id-1) as slot_date, | ||||
| 	fe.id as next_id, | ||||
| 	(SELECT date(eps.date,\'+1 day\') from eps where id = fe.id-1) as next_date, | ||||
| 	printf(\'%i\',abs(julianday((SELECT date(eps.date,\'+1 day\') from eps where id = fe.id-1)) - julianday(\'now\') + 1)) AS delta_days | ||||
|     FROM first_empty AS fe | ||||
|     LEFT JOIN eps e ON fe.id = e.id | ||||
|   | ||||
		Reference in New Issue
	
	Block a user