как правильно конец дня? 24.00.00 или 00.00.00
так правильно тогда?
switch ($acti)
{
case 1:
if ($todaysmen > '00.00.00' and $todaysmen < '08.00.00'){
$choise = " (\"F_TagName_ID\" = $val1 or \"F_TagName_ID\" = $val2) and \"F_Date\" >(timestamp\'$dt 20:00:00\' - \"interval\" \'1 day\') and \"F_Date\" <= timestamp\'$dt 8:00:00\' ";
}
else
{
$choise = " (\"F_TagName_ID\" = $val1 or \"F_TagName_ID\" = $val2) and \"F_Date\" >(timestamp\'$dt 20:00:00\') and \"F_Date\" <= (timestamp\'$dt 8:00:00\' + - \"interval\" \'1 day\') ";
}
break;
case 2 :
$choise = " (\"F_TagName_ID\" = $val1 or \"F_TagName_ID\" = $val2) and \"F_Date\" >timestamp\'$dt 8:00:00\' and \"F_Date\" <= timestamp\'$dt 20:00:00\'";
//$acti = null;
break;
case 3 :
$choise = " (\"F_TagName_ID\" = $val1 or \"F_TagName_ID\" = $val2) and \"F_Date\" >(timestamp\'$dt 20:00:00\' - \"interval\" \'1 day\') and \"F_Date\" <= timestamp\'$dt 20:00:00\'";
//$acti = null;
break;
}
$acti - 1 смена с 20.00 до 8.00
2 смена с 8.00 до 20.00
3 - выбран день с 20.00 до 20.00