no se si es valido pero lo resolví de esta manera <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-html --> Movimiento = new Func<string>(() => { if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker1.Value.ToString("dd/MM/yyyy") && c.CheckType == 0) { return "ENTRADA"; } if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker1.Value.ToString("dd/MM/yyyy") && c.CheckType == 1) { return "SALIDA"; } if (c.CheckTime.ToString("dd/MM/yyyy") == dateTimePicker2.Value.ToString("dd/MM/yyyy") && c.CheckType == 1) { return "SALIDA"; } return null; } ) () <!-- end snippet -->