Android Question Select case for comparing dates

Discussion in 'Android Questions' started by Espinosa4, Jul 1, 2015.

  1. Espinosa4

    Espinosa4 Active Member Licensed User

    Hello,

    is it possible to do this?

    Code:
    Sub DameAhoraServicios(Fechita As Long)
        
    DateTime.DateFormat = "dd/MM/yyyy"
        
    Select Fechita
        
    Case Fechita < DateTime.DateParse("01/07/2015")
            
    If Esdinamico = False Then
                AhoraServicios = Servicios
            
    Else
                AhoraServicios = 
    "MARZO2013"
            
    End If
        
    Case Fechita = DateTime.DateParse("01/07/2015")
            
    If Esdinamico = False Then
                AhoraServicios = Servicios
            
    Else
                AhoraServicios = 
    "JULIO2015"
            
    End If
        
    Case Fechita > DateTime.DateParse("01/07/2015")
            
    If Esdinamico = False Then
                AhoraServicios = Servicios
            
    Else
                AhoraServicios = 
    "MARZO2013"
            
    End If
        
    End Select
    End Sub
    Thank you!!
     
  2. Espinosa4

    Espinosa4 Active Member Licensed User

    Sorry, I need to use if.
    :oops:
     
  3. klaus

    klaus Expert Licensed User

    You could do it with Select.
    Replace
    Select Fechita
    by
    Select True
     
    Erel and Espinosa4 like this.
  4. Espinosa4

    Espinosa4 Active Member Licensed User

    Ahhhhh Thank you Klaus!!! Now I understand

    Cheers
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice