Solved LikeNot in multiple criteria in Dcount (1 Viewer)

zelarra821

Registered User.
Local time
Today, 12:34
Joined
Jan 14, 2019
Messages
803
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, 12:34
Joined
Jan 14, 2019
Messages
803
No, keep failing
 

CJ_London

Super Moderator
Staff member
Local time
Today, 11:34
Joined
Feb 19, 2013
Messages
16,553
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
Today, 22:34
Joined
Jan 20, 2009
Messages
12,849
Why are you bothering to concatenate literal strings and numbers?
 

CJ_London

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

Users who are viewing this thread

Top Bottom