Selasa, 29 Agustus 2017

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 
(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...


Query1
DOCTYPENumOf
accdb1
doc5
docx3
htm3
jpg3
mht1
mp32
pdf15
pub1
SAV1
txt1
UBK1
xlsx3


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


Art,


What do you get with a query like:


SELECT [Doc Type], Count(*) as NumOf

FROM tblDocumentMain

GROUP BY [Doc Type];


Does your Doc Type field actually store the periods or just the extension?


Regards,

Duane




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
 


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

 

Art- 


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
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

 


I have the following dcount expression in a text box:


=DCount("[DOC_ID]","tblDocumentMain","[DOCTYPE] LIKE doc*")


I am try to return the number of records that are Like doc*


Thank You


Art Lorenzini

Sioux Falls, SD










__._,_.___

Posted by: Art Lorenzini <dbalorenzini@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (11)

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