void delete_client(){
FILE *annuaire_client,*annuaire1;
printf("\t\t\t\t\t\t\t\tNum de compte a supprimee: ");
int delete_line;
scanf("%d",&delete_line);
char ch;
int line = 1;
//ouvrir le fichier original
annuaire_client = fopen("annuaire_client.txt", "r");
ch = getc(annuaire_client);
//retour au debut
rewind(annuaire_client);
//ouvrir nouveau fichier
annuaire1 = fopen("annuaire1.txt", "w");
while (ch != EOF)
{
if (ch == '\n')
{
line++;
}
//sautez la line a supprimer
if (line != delete_line)
{
//copier les lines vers annuaire1.txt
fprintf(annuaire1,"%c",ch);
}
ch = getc(annuaire_client);
}
fclose(annuaire1);
fclose(annuaire_client);
remove("annuaire_client.txt");
rename("annuaire1.txt","annuaire_client.txt");
}
是否可以将总和作为Iff函数中的值返回? 我需要过滤价值' BOX'如果是BOX,则返回查询中计算的2个其他和的总和,否则返回0.
这可以吗?如果是,我该如何解决?
谢谢!
答案 0 :(得分:0)
我在评论中使用了potashin的提示。
你已经非常接近了,这就是你想要的:
=Sum(IIf(Fields!HOLDER_UNIT.Value ='BOX', Sum(Fields!f1.Value + Fields!f3.Value), 0))