[AccessD] Filtering with International Dates

Rocky Smolin rockysmolin at bchacc.com
Thu Sep 22 13:47:02 CDT 2011


This seems to work:

Format$(varDate, "\#mm\/dd\/yyyy\#")

Is that the best solution?  

Rocky
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
Sent: 22 September 2011 11:37
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Filtering with International Dates

Dear List:
 
Because I'm old and can't remember (and the archives are down), I was told
how to filter with dates so that if a user is using international dates it
doesn't matter.
 
The following code:
 
    If Nz(Forms!frmPOReport!txtGEPromisedDate) <> "" Then
        If Len(strSQL) <> 0 Then strSQL = strSQL & " AND "
        strSQL = strSQL & "fldPOPromisedDate >= #" &
Forms!frmPOReport!txtGEPromisedDate & "# "
    End If
    
    If Nz(Forms!frmPOReport!txtLEPromisedDate) <> "" Then
        If Len(strSQL) <> 0 Then strSQL = strSQL & " AND "
        strSQL = strSQL & "fldPOPromisedDate <= #" &
Forms!frmPOReport!txtLEPromisedDate & "# "
 
strSQL eventually ends up in Me.Filter.
 
Works good in the USA.  :) Fails in Nicaragua. :(
 
Was it CDate I was supposed to use?
 
Sorry for the redux.
 
TIA
 
Rocky
 
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list