This sql statement will show any account numbers that have a balance in any period and are not in any of the formats:

 

select gl_account_no from"gl_accounts"

where (period_balance_00 <> 0 or period_balance_01 <> 0 or period_balance_02 <> 0 or period_balance_03 <> 0 or

period_balance_04 <> 0 or period_balance_05 <> 0 or period_balance_06 <> 0 or

period_balance_07 <> 0 or period_balance_08 <> 0 or period_balance_09 <> 0 or

period_balance_10 <> 0 or period_balance_11 <> 0 or period_balance_12 <> 0 or

period_balance_13 <> 0 or period_balance_14 <> 0 or period_balance_15 <> 0 or

period_balance_16 <> 0 or period_balance_17 <> 0 or period_balance_18 <> 0 or

period_balance_19 <> 0 or period_balance_20 <> 0 or period_balance_21 <> 0 or

period_balance_22 <> 0 or period_balance_23 <> 0 or period_balance_24 <> 0)

and gl_account_no not in (select account_no FROM"gl_statement_formats")