sql - Append from dynamic temp table -


this question might have been asked before, i've spent considerable time looking answer withouth success... because i'm quite new @ this, answer might there, fail identify it.

i raw data in csv showing me times our agents spent on statuses (break, email, meeting, lunch, ...). there column each status.

i import csv temporary tabel in access, append master table. have several times day.

the problem is, in morning, if none of agents went on lunch status, column not in csv file.the columns there if used. thus, when try append it, give error , ask parameter value column.

this append code in access:

insert t0_reason_codes ( [date], agent, [agent first name], [agent last name], [agent email], [hour], [break / agent state time], [casenotes / agent state time], [email / agent state time], [lunch / agent state time], [project / agent state time], [remote session / agent state time], [training / agent state time] )  select q0_reason_codes.date, q0_reason_codes.agent, q0_reason_codes.[agent first name], q0_reason_codes.[agent last name], q0_reason_codes.[agent email], q0_reason_codes.hour, q0_reason_codes.[break / agent state time], q0_reason_codes.[casenotes / agent state time], q0_reason_codes.[email / agent state time], q0_reason_codes.[lunch / agent state time], q0_reason_codes.[project / agent state time], q0_reason_codes.[remote session / agent state time], q0_reason_codes.[training / agent state time]  q0_reason_codes left join t0_reason_codes on (q0_reason_codes.[date] = t0_reason_codes.[date]) , (q0_reason_codes.[hour] = t0_reason_codes.[hour]) , (q0_reason_codes.[agent] = t0_reason_codes.[agent])  (((([t0_reason_codes].[date] null) , [t0_reason_codes].[agent] null , [t0_reason_codes].[hour]) null)); 

the workaround can think of is, in excel write script checks if column exists , create if not.

are there better ways this?


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -