Merhaba,
Bunu Access'te nasıl yazarım?
= EĞER (VE (G5 <> ""; I5 = ""); G5; EĞER (VE (G5 = ""; I5 <> ""); I5; EĞER (VE (G5 <> ""; I5 <> ""); I5 ve "-" & G5)))
Merhaba,
Bunu Access'te nasıl yazarım?
= EĞER (VE (G5 <> ""; I5 = ""); G5; EĞER (VE (G5 = ""; I5 <> ""); I5; EĞER (VE (G5 <> ""; I5 <> ""); I5 ve "-" & G5)))
Please translate into English and post English or both versions so that we don't have to translate. You can then translate English answers.
Hello there,
How do I write this in Access?
Code:= IF (AND (G5 <> ""; I5 = ""); G5; IF (AND (G5 = ""; I5 <> ""); I5; IF (AND (G5 <> ""; I5 <> ""); I5 and "-" & G5)))
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
= IF (AND (G5 <> ""; I5 = ""); G5; IF (AND (G5 = ""; I5 <> ""); I5; IF (AND (G5 <> ""; I5 <> ""); I5 and "-" & G5)))
How can I do this in access?
=IF(AND(G5<>"";I5="");G5;IF(AND(G5="";I5<>"");I5;I F(AND(G5<>"";I5<>"");I5&" - "&G5)))
I don't see how you can. Mostly, Access does not have row:column identifiers, so I5 is meaningless. It also does not have an AND function (at least that's my opinion although you may find web pages that say different. In Access, AND is a logical operator like OR, XOR, and maybe BETWEEN and LIKE). The equivalent to IF in Access is IIF. The AND function has to be written as
(G5<>"" AND I5="")
You could try to nest several IIF expressions together (like they were IF's) while using syntax like x AND y but nested IIF's drive me to drink, so I rarely do them. Each IIF has 3 parts; expression, value if True and value if false. Also is interesting that you separated your Excel formula with semi colons (. I would have thought that would be a problem.
Maybe you should post what you have for data, and what result you need from such an expression. No guarantee that I/we can help.
Last edited by Micron; 09-26-2018 at 03:37 PM. Reason: added info
Instead of nested IIf(), Switch or Choose might be possible.
How does this calculation relate to Access? Are you importing data from Excel and now want to do the same calc in Access? What are the field names?
Maybe:
=Switch(G5 <> "" And I5 = "", G5, G5 = "" And 15 <> "", I5, True, I5 - G5)
Substitute appropriate field names for the cell references.
Or if fields are number type, they cannot hold empty string and therefore testing for empty string is useless. Number fields with no data would be Null.
=Switch(Not IsNull(G5) And IsNull(I5), G5, IsNull(G5) And Not IsNull(15), I5, True, I5 - G5)
Or use Nz():
=Nz(I5,0) - Nz(G5,0)
Last edited by June7; 09-27-2018 at 02:12 AM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
now cross posted here
https://www.mrexcel.com/forum/micros...nt-access.html
Ordinarily I would provide the usual link, but he/she continues to post in Turkish(?) so I don't see the point.
you can use the switch function or a nested iifHow can I do this in access?
=IF(AND(G5<>"";I5="");G5;IF(AND(G5="";I5<>"");I5;I F(AND(G5<>"";I5<>"");I5&" - "&G5)))
=iif(G5<>"" AND I5="",G5,iif(G5="" AND I5<>"",I5,I5 & " - " & G5))
there is no need for the third IF or iif since there are no other options. Replace G5 and I5 with your field names
you may also need to use the nz function because a blank string could be a ZLS (zero length string - "") or a null
=iif(nz(G5,"")<>"" AND nz(I5,"")="",G5,iif(nz(G5,"")="" AND nz(I5,"")<>"",I5,I5 & " - " & G5))