Counting Records in SQL

exaccess

Registered User.
Local time
Today, 23:46
Joined
Apr 21, 2013
Messages
287
What is the best way to attack the problem. Here is sample code, which was working yesterday and after the addition of a column to the underlying table to day does not work.
Code:
I = DCount("Language", "[" & Orig & "]", "[Language] <> 'X'")
Here I is integer counter, Language is the name of field . Orig is the underlying table name. Help please
 
You are making that more complicated than it needs to be. Try

Code:
I = DCount("Language", "Orig", "[Language] <> 'X'")
 
You are making that more complicated than it needs to be. Try

Code:
I = DCount("Language", "Orig", "[Language] <> 'X'")

Sorry for coming back after days but I had to rush to another project. May be I mislead you Orig is a variable which can take the name of a table. This construction does not work.
 
Okay Try this

Code:
Dim sTableName as String
sTableName = Orig

i = Dcount("language",sTableName,"[Language] <> 'X'")
 
Minty,

Wouldn't
Code:
i = Dcount("language",Orig,"[Language] <> 'X'")
work just as well?
 
It might but I wanted to ensure it was a string value, I should have added a debug in there to make the point I guess...
 
Thanks Gasman and Minty. I will try the second version soon and come back .
 
It might but I wanted to ensure it was a string value, I should have added a debug in there to make the point I guess...

Ah, I see.
Thanks for explaining. I would never have thought of that.
 

Users who are viewing this thread

Back
Top Bottom