Art,
You should also be able to use the simpler:
=DCount("[Doc_ID]","tblDocumentMain","[DocType] IN ( 'mdb', 'accdb')")
Duane Hookom
MN
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, August 29, 2017 4:34 PM
To: John Viescas JohnV@msn.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] DCount expression not working
Sent: Tuesday, August 29, 2017 4:34 PM
To: John Viescas JohnV@msn.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] DCount expression not working
Thank you that did it. The Expression is now:
=DCount("[Doc_ID]","tblDocumentMain","[DocType]= 'mdb' OR [DocType] = 'accdb'")
With Warm Regards,
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265 Ext. 130
Fax (605)964-1070
"Valar Dohaeris"
From: John Viescas JohnV@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
To: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, August 29, 2017 04:29:54 PM
Subject: Re: [MS_AccessPros] DCount expression not working
Art-
Then remove the stupid . in front of both search parameters. And instead of doing LIKE, it looks like you could do =.
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
http://www.viescas.com/
www.viescas.com If you're at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book recommendations and all the cool links! |
(Paris, France)
On Aug 29, 2017, at 11:19 PM, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
Duane,
I ran your query and got this...
DOCTYPE | NumOf |
---|---|
accdb | 1 |
doc | 5 |
docx | 3 |
htm | 3 |
jpg | 3 |
mht | 1 |
mp3 | 2 |
15 | |
pub | 1 |
SAV | 1 |
txt | 1 |
UBK | 1 |
xlsx | 3 |
And I do not store the period.
With Warm Regards,
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265 Ext. 130
Fax (605)964-1070
"Valar Dohaeris"
From: Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, August 29, 2017 04:07:37 PM
Subject: Re: [MS_AccessPros] DCount expression not working
From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of Art Lorenzini dbalorenzini@yahoo.com[MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, August 29, 2017 3:05 PM
To: John Viescas JohnV@msn.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] DCount expression not working
Sent: Tuesday, August 29, 2017 3:05 PM
To: John Viescas JohnV@msn.com [MS_Access_Professionals]
Subject: Re: [MS_AccessPros] DCount expression not working
This is what I got and its still return 0
=DCount("[Doc_ID]","tblDocumentMain","[DocType] LIKE '*.mdb*' OR [DocType] LIKE '*.accdb*'")
With Warm Regards,
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265 Ext. 130
Fax (605)964-1070
"Valar Dohaeris"
From: John Viescas JohnV@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, August 29, 2017 09:57:11 AM
Subject: Re: [MS_AccessPros] DCount expression not working
Note with my test that the .mdb or .accdb must be at the very end of the file name. If there's a trailing blank or other characters, you won't get a match. You could try adding an asterisk at the end.
"[DocType] LIKE '*.mdb*' OR [DocType] LIKE '*.accdb*'"
John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
http://www.viescas.com/
If you're at all interested in Microsoft Access or SQL Server, this is the place to be! Check out the book recommendations and all the cool links! |
(Paris, France)
On Aug 29, 2017, at 4:01 PM, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I tried this and it returns 0 and I check the underlying table and there are 3 records that match that criteria.
With Warm Regards,
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265 Ext. 130
Fax (605)964-1070
"Valar Dohaeris"
From: John Viescas JohnV@msn.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Tuesday, August 29, 2017 01:48:36 AM
Subject: Re: [MS_AccessPros] DCount expression not working
Art-
Third parameter:
"[DocType] LIKE '*.mdb' OR [DocType] LIKE '*.accdb'"
Notice that I changed your parameter string to look for characters on the end of the string and included a '.'. Your original test would include any file name that just happened to have "mdb" somewhere in the name.
John Viescas, author
John Viescas, author
Effective SQL
SQL Queries for Mere Mortals
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Access Applications
On Aug 29, 2017, at 03:16, Art Lorenzini dbalorenzini@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:
I actually found the solution but now I have to add another Like to it to cove accdb...
=DCount("[Doc_ID]","tblDocumentMain","[DOCTYPE] Like '*mdb*'")
With Warm Regards,
Arthur D. Lorenzini
IT System Manager
Cheyenne River Housing Authority
Wk.(605)964-4265 Ext. 130
Fax (605)964-1070
"Valar Dohaeris"
Sent: Monday, August 28, 2017 07:43:52 PM
Subject: [MS_AccessPros] DCount expression not working
__._,_.___
Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (12) |
Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
.
__,_._,___
Tidak ada komentar:
Posting Komentar