Re: DCount WHERE Clause using Date function -
04-22-2010
, 10:23 AM
DCount returns an integer value which would be the count of rows in a
table (or dataset -- query) that meet a giver criteria. I'm not sure
what -- rec("In") -- represents. Here is a sample usage of DCount
(including the source data -- from Table2)
'--source data for DCount example from Table2
fyear fld1 fld2
2000 abc1 abc12
2000 abc1 abc13
2001 abc1 abc12
2002 abc1 abc12
2002 abc1 abc13
Sub DcountThing()
Dim i As Integer
i = DCount("[fld2]", "Table2", "InStr(1,[fld2],'2')>0")
Debug.Print "i is " & i
End Sub
This will return a "3" because there are 3 rows where fld2 contains a
"2" in the value.
Rich
*** Sent via Developersdex http://www.developersdex.com *** |