Avatar billede nyholm Novice
22. januar 2007 - 23:10 Der er 8 kommentarer og
1 løsning

Kod i rapport

Hej alla!
Ær det någon som kan hjælpa mig med en kod som gør att man undviker felmarkering nær man dividerar 2 værden och det ena råkar vara noll. Jag førsøkte med "=OOM(([Netto]/[TotKm])>0;[Netto]/[TotKm];0)", men det hjælpte inte.
Avatar billede terry Ekspert
23. januar 2007 - 08:06 #1
Not sure I understand what your writing.
"undviker felmarkering" what does that mean?
Also, what is the OOM function? It looks as though it is doing the same as iif()


=IIF(Netto]/[TotKm])>0;[Netto]/[TotKm];0)
Avatar billede nyholm Novice
23. januar 2007 - 10:11 #2
Hi Terry!
Dividing with zero gives the result #NUM! and that is what I want to avoid.
The OOM function is the same as iif, bud in the swedish version.
Avatar billede terry Ekspert
23. januar 2007 - 10:22 #3
I would have though that if you devide by 0 then it would give an error.
So you need to convert the 0 into for example 1.

=IIF(Netto]/[TotKm])>0;[Netto]/[TotKm];0)
Avatar billede terry Ekspert
23. januar 2007 - 10:23 #4
oops, pressed too soon.

=IIF(Netto]/iif([TotKm] = 0, 1, [TotKm])>0;[Netto]/[TotKm];0)
Avatar billede terry Ekspert
23. januar 2007 - 10:24 #5
anyway, use iif to test if your vaklues are 0 and convert to Ex. 1
Avatar billede nyholm Novice
23. januar 2007 - 11:01 #6
If one of [Netto]or [TotKm]is 0, I want the result to be 0 and not the errormark #NUM!. If I convert the 0 into 1, I will get a result as if the actual value is 1 and then the result is false.
Avatar billede terry Ekspert
23. januar 2007 - 11:08 #7
I havent ried this before but cant see why it shouldnt work

=IIF(Netto] = 0 or [TotKm] = 0; 0;[Netto]/[TotKm])
Avatar billede nyholm Novice
23. januar 2007 - 11:26 #8
Yes! Thank You Terry!
Avatar billede terry Ekspert
23. januar 2007 - 11:44 #9
Your welcome :o)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester