diff --git a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl index 21f2e32..bc571b3 100644 --- a/src-modules/module/rpta/schluesseltabellen/fm_templates.unl +++ b/src-modules/module/rpta/schluesseltabellen/fm_templates.unl @@ -550,18 +550,19 @@ select '${removeEmptyLines}';\ \ \ from tmp_stud2\ - <#if removeEmptyLines=="true" >where 1=0\ - <#foreach column in columns>\ - <#assign count_aggregate=0>\ - <#if column.is_aggregate==1>\ - <#assign count_aggregate=count_aggregate+1>\ - or ${column.targetfieldname} is not null\ - -- folgende elseif sorgt dafür, dass Spaltenlayouts ohne Aggregate immer true sind\ - -- denn ohne diese elseif wären Spaltenlayout ohne Aggregate immer false\ - <#elseif column.is_aggregate==0 && column?is_last && count_aggregate=0>\ - or 1=1\ - \ - \ + <#if removeEmptyLines=="true">\ + where 1=0\ + <#assign count_aggregate=0>\ + <#foreach column in columns>\ + <#if column.is_aggregate==1>\ + <#assign count_aggregate=count_aggregate+1>\ + or ${column.targetfieldname} is not null\ + or trim(${column.targetfieldname}::varchar(255)) != ''\ + \ + \ + <#if count_aggregate==0>\ + or 1=1\ + \ \ order by \ <#if rpta_column_layout.sortclause?has_content>\