Question : Work around American date in DCount

I am trying to us dcount to find the number of application stages that has expired. I am getting erroneous answer. I know that the error is due to the fact that VB code is american base so when I am trying to find a date that is before today 9/12/09 it actually look for a date before 12 September 2009. Can any one help with a work around. See my code attached
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
Option Explicit
Public lngAcknowledgementLasped As Long
Public lngAcknoledgementClose As Long
Public lngInfoRequestLasped As Long
Public lngInfoRequestClose As Long
Public sumLasped As Long
Public strLasped As String
 
Function stageLaspe()
 
lngAcknowledgementLasped = DCount("fldApplicationStageId", "tblApplicationstage", _
"fldStage =" & 2 & " And fldDuedate <" & Chr(35) & Date & Chr(35) & " And isnull(fldDateCompleted)")
 
sumLasped = lngAcknowledgementLasped
 
If lngAcknowledgementLasped <> 0 Then
 
strLasped = lngAcknowledgementLasped & " applications has passed acknowledgement period" & vbCrLf
 
End If
 
 
End Function

Answer : Work around American date in DCount

I thinkk you are creating this problem by putting the date function outside the " ".

lngAcknowledgementLasped = DCount("fldApplicationStageId", "tblApplicationstage", _
"fldStage = 2  And fldDuedate
Random Solutions  
 
programming4us programming4us