def computeDatecode(row):
    """Creates a datecode (which permits sorting the dates ascending) for each row in the original dataset.
    
    Parameters: 
    -----------
    row : pandas Series 
        row of a dataset
    
    Returns:
    -----------
        Either None (wrong date format)
        Or the computed code (int)
    """
    try:
        day, month, year = row.Date[:2], row.Date[3:5], row.Date[6:10]
        N = int(year + month + day)
    
    except:
        N = None

    return N