我需要将加入日期字段与当前日期进行比较
加入日期字段是单行文本字段,我希望使用CAML查询比较当前日期
注意:由于我们在代码中的许多地方使用了此(加入日期)字段,因此我们无法将此加入日期字段(文本字段)更改为日期时间字段。
这是我使用的代码
<Where>
<And>
<Leq>
<FieldRef Name='Join_Date' />
<Value Type='Text'>" + Convert.ToDateTime(DateTime.Now).ToString("dd-MM-yyyy") + @"</Value>
</Leq>
<Eq>
<FieldRef Name='Office_ID_txt' />
<Value Type='Text'>" + country +@"</Value>
</Eq>
</And>
</Where>