|
|
|
Дни Полётов
|
|||
|---|---|---|---|
|
#18+
С Новым Годом, всех. Мне необходимо, посчитать колличество оставшихся дней на constraint. Вот что я имею.. Select Top 1 MC_Rotable.hours_since_last_maint, MC_Rotable.last_complete_date, 'constr_hours' = (1.0 + isnull(mc_rotable.Extention_Multiplier,0) * isnull(Maintenance_Code.Extention_Pcnt,0) / 100.0) * Maintenance_code.Hours, Since_Last = convert(varchar(12), round(rotable_inventory.company_hours - mc_rotable.inv_hours_at_start_date + mc_rotable.hours_since_last_maint, 1)), Remaining = convert(varchar(12), Round(Maintenance_Code.Hours * (1 + .01 * isnull(maintenance_code.extention_pcnt,0) * isnull(mc_rotable.extention_multiplier,0)) - (rotable_inventory.Company_hours - mc_rotable.inv_hours_at_start_date + mc_rotable.hours_since_last_maint ),1)) from MC_Rotable, Rotable_inventory, Maintenance_code Where MC_rotable.inv_oid = :inv_oid and (Maintenance_code.maintenance_code like '747-C%' or Maintenance_code.maintenance_code like '%NEXT "C" CHECK%') and rotable_inventory.oid = Mc_rotable.inv_oid and ( MC_Rotable.MC_Oid = Maintenance_Code.Oid ) Order by Mc_rotable.last_complete_date DESC но это для constraints которые имеют часы, мне нужно сделать тоже самое для constr. с DAYS ( и это будет не календарных дней а дней полёта) Пример... plane может летать несколькко полетов в 1 день, считать этот день как 1 день полёта. Дни полёта могут быть не consecutive ( не подряд) Select Top 1 'constr_days' = Maintenance_code.days, Since_Last = ???? Remaining = ???? from MC_Rotable, Rotable_inventory, Maintenance_code Where MC_rotable.inv_oid = :inv_oid and rotable_inventory.oid = Mc_rotable.inv_oid and ( MC_Rotable.MC_Oid = Maintenance_Code.Oid ) Order by Mc_rotable.last_complete_date DESC Заранее Спасибо. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.01.2007, 18:12 |
|
||
|
Дни Полётов
|
|||
|---|---|---|---|
|
#18+
затянулось похмелье у Светы однако ... причём тут PowerBuilder ??? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 08.01.2007, 23:49 |
|
||
|
Дни Полётов
|
|||
|---|---|---|---|
|
#18+
вопрос конечно не по билдеру абсолютно. мало того, нет данных чтобы нанего ответить (например структуры таблиц) зы: если у вас есть какая-то дата полета, то возможно вытаскивать примерно так: select count(distinct flight_date) from ... where ... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 09.01.2007, 11:01 |
|
||
|
|

start [/forum/topic.php?fid=15&fpage=62&tid=1337386]: |
0ms |
get settings: |
9ms |
get forum list: |
13ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
32ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
47ms |
get tp. blocked users: |
1ms |
| others: | 256ms |
| total: | 375ms |

| 0 / 0 |
