Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Rotterdam
    Posts
    17

    Exclamation Unanswered: Access Project and Server Filter

    I am having a problem with the Server Filter property of one of my forms.

    One off the fields on the form contains a date/time value. When a user uses this field to construct a server filter he gets an error telling hem, that the sql statement is not correct.

    The problem is caused by the fact that sql server needs a date format of 'dd-mm-yyyy' (sql server will automatically convert this to mm-dd-yyyy) and the Server Filter property construct a filter like #dd-mm-yyyy# (witch sql server can't convert).

    Does anybody know a solution for this problem?
    Peter Dorsman

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Make your own Function

    PHP Code:
    Function CSQLDate(varDate As Variant) As String

       
    ' This funktion changes any given date format 
       ' 
    to a string that used in the SQL-Statment

     
    If IsDate(varDateThen
       CSQLDate 
    "#" Month(varDate) & "/" 
               Day
    (varDate) & "/" Year(varDate) & "#"
        
    Else
            
    CSQLDate ""
        
    End If

    End Function 

  3. #3
    Join Date
    Oct 2003
    Location
    Rotterdam
    Posts
    17
    I understand what the function does, but don't understands how to use it in a form that is in the "Server Filter" mode
    Peter Dorsman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •