LikeNot in multiple criteria in Dcount (1 Viewer)

zelarra821

Registered User.
Local time
Today, 14:57
Joined
Jan 14, 2019
Messages
86
Hi. I am trying to make this formula work in an Access report, but it gives me an error. Could you tell me where the fault is? I know it is from [PorQueAñadoEsteLibro].

=DCont("*";"[TLibros]";"[Comprado]=" & Verdadero & " And " & "[Estado]=" & 3 & " And " & "[Libreria]=" & 2 & " And " & "[PorQueAñadoEsteLibro]" & "NotLike" & "*" & "Kindle Unlimited" & "*")

Thanks.
 

zelarra821

Registered User.
Local time
Today, 14:57
Joined
Jan 14, 2019
Messages
86
No, keep failing
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:57
Joined
Feb 19, 2013
Messages
11,765
try dcount rather than dcont

also seem to be missing some single quotes and you can also simplify your code a bit

=DCount("*";"[TLibros]";"[Comprado]=" & Verdadero & " And [Estado]= 3 And [Libreria]= 2 And [PorQueAñadoEsteLibro] Not Like '*Kindle Unlimited*'")
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 01:57
Joined
Jan 20, 2009
Messages
11,857
Why are you bothering to concatenate literal strings and numbers?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:57
Joined
Feb 19, 2013
Messages
11,765
I added a bit more to my post - take another look re single quotes
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom