🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: de.comp.datenbanken.ms-access
3 messages
3 total messages Started by Forrest Gump Sat, 20 Nov 2021 16:29
"wenn nz...dann...sonst" funzt nicht
#154337
Author: Forrest Gump
Date: Sat, 20 Nov 2021 16:29
27 lines
630 bytes
Hallo

Was ist hier falsch? ->

=Wenn(Nz([Vorname];0)=0;[Nachname];[Vorname] & " " & [Nachname])

Die Ausgabe ist wie erwartet [Nachname], wenn [Vorname] 0 oder Null ist.
Wenn die Bedingung aber nicht erfüllt ist, ist die Ausgabe ein "#Typ!".

=[Vorname] & " " & [Nachname]
alleine funktioniert.

Ich traue meiner Access-Installation nicht mehr wirklich. Ich hatte
schon öfters Fehlerkonstellationen damit. Darum bin ich nicht sicher, ob
in der obigen Formel wirklich ein Fehler ist. Ich sehe leider keinen.

Vielen Dank.

Grüsse
Forrest




--
"Das Gute an Vietnam war, dass man immer irgendwas vorhatte."
Forrest Gump
---
Re: "wenn nz...dann...sonst" funzt nicht
#154338
Author: Karl Donaubauer
Date: Sat, 20 Nov 2021 19:28
33 lines
846 bytes
Hallo!

Forrest Gump:
> ...
> Was ist hier falsch? ->
>
> =Wenn(Nz([Vorname];0)=0;[Nachname];[Vorname] & " " & [Nachname])
>
> Die Ausgabe ist wie erwartet [Nachname], wenn [Vorname] 0 oder Null ist.
> Wenn die Bedingung aber nicht erfüllt ist, ist die Ausgabe ein "#Typ!".
>
> =[Vorname] & " " & [Nachname]
> alleine funktioniert.
>

Die Datentypen passen nicht zusammen. Vorname ist vom Typ Text, und
deine Nz-Prüfung arbeitet mit Zahlen. Um den Fehler zu vermeiden,
müsstest du z.B. aus den Nullern Texte machen:

=Wenn(Nz([Vorname];"0")="0";[Nachname];[Vorname] & " " & [Nachname])

Kürzer wäre hier:

=[Vorname] + " " & [Nachname])

s.a. https://www.donkarl.com?FAQ2.12

--
Servus
Karl
*********
Access-Entwickler-Konferenz: https://www.donkarl.com/?AEK
Access DevCon: http://AccessDevCon.com
Access FAQ: https://www.donkarl.com
Re: "wenn nz...dann...sonst" funzt nicht
#154339
Author: Forrest Gump
Date: Mon, 22 Nov 2021 08:20
19 lines
342 bytes
Also sprach Karl Donaubauer am 20.11.2021 um 19:28:

> =Wenn(Nz([Vorname];"0")="0";[Nachname];[Vorname] & " " & [Nachname])
>
> Kürzer wäre hier:
>
> =[Vorname] + " " & [Nachname])
>
> s.a. https://www.donkarl.com?FAQ2.12

Vielen Dank!

Grüsse
Forrest


--
"Das Gute an Vietnam war, dass man immer irgendwas vorhatte."
Forrest Gump
---
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads