So I'm trying to build a CAML Query in SharePoint to query a list where Date is greater than a certain value say 1/1/2016, my CAML looks kinda like this
<Where>
<Geq>
<FieldRef name = 'BillingDate'/>
<value type='DateTime'>1/1/2016</value>
</Geq>
</Where>
When I do this with the list, I get weird results. Upon looking at this list I found out that the BillingDate field is actually a text field and not a date. I'm kinda loathe to change it to a Date Field since this is a long standing app with lots of business logic that might be reliant on Billing Date being a text field. I'm using PowerShell for querying.
Is there any way offhand to cast a text field as a Date for CAML purposes? I'm fairly certain all the date values would cast just fine (didn't see anything invalid offhand). Another thought I had was maybe creating a new date field "BillingDate_2" and migrating the data from one to another. Then maybe I can query. However if anyone's ever managed to cast a SharePoint field as something else in query it may be the simpler solution here.