Выделить записи в таблице по некоторому сложному условию — различия между версиями
Материал из Фабиус wiki
Hisava (обсуждение | вклад) м (→2) |
Hisava (обсуждение | вклад) м (→2) |
||
Строка 15: | Строка 15: | ||
sql := [ Select RGNUM From [[DOCS]]] + [[Ret_f_ext]]() + [ Where KINDDOC = '[[ESJ]]' and LVLNUM = '2' and [[Left]]( CATTR5, 5 ) = ' 103' and ; | sql := [ Select RGNUM From [[DOCS]]] + [[Ret_f_ext]]() + [ Where KINDDOC = '[[ESJ]]' and LVLNUM = '2' and [[Left]]( CATTR5, 5 ) = ' 103' and ; | ||
− | ( [[Left]]( ] + [[ | + | ( [[Left]]( ] + [[SQLFIELD]]( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '01.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '02.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '03.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '04.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '05.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '06.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '07.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '08.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '09.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '10.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '11.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '12.03' or ; |
− | Left( ] + | + | Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '13.03' ; |
) ] | ) ] | ||
Версия 15:32, 8 июня 2017
1
local aa, sql, flt sql := [ Select RGNUM From DOCS] + Ret_f_ext() + [ Where KINDDOC = 'MTR' ] aa := SelectSqlToArr( sql, { 'RGNUM' } ) if !IsEmpty( aa ) aa := PrepareArr( aa ) flt := CREATE_FILT_FROM_ARR( 'RGNUM', aa ) SetFilter( flt ) SetSelRows( , true ) endif
2
local aa, sql, flt sql := [ Select RGNUM From DOCS] + Ret_f_ext() + [ Where KINDDOC = 'ESJ' and LVLNUM = '2' and Left( CATTR5, 5 ) = ' 103' and ; ( Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '01.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '02.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '03.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '04.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '05.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '06.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '07.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '08.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '09.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '10.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '11.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '12.03' or ; Left( ] + SQLFIELD( '_TIMEFIRST',, 'sql_char' ) + [, 5 ) = '13.03' ; ) ] aa := SelectSqlToArr( sql, { 'RGNUM' } ) if !IsEmpty( aa ) aa := PrepareArr( aa ) flt := Create_Filt_From_Arr( 'RGNUM', aa ) SetFilter( flt ) SetSelRows( , true ) endif
Смотрите также
Шаблоны программ на внутреннем языке фабиуса для повторного использования