if(F2="本科室项目",sql("mysq-xmgl","select project_code from project.list where dept='"+dept+"'",1),if(F2="非本科室项目",sql("mysql-xmgl","selectprojectcode from project.list where dept<>(select dept from project list where dept='"+dept+"')",1),""))dept是科室字段,project_code项目编号目前解决的问题是选本科室出现的是本科室的项目编号,选非本科室是其他科室的科室的项目编号,但是现在要在假如选择了非本科室,出现的是其他科室的名称,选中这个科室名称才会出现这个科室的项目编号,这个逻辑怎么加,if怎么写,嵌套,求助,