I have a calculated column that stores the calculated date value.
When I apply the CAML query, it does not return any row even if the record exists.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
This might be related to what you use as value type in your CAML. The type must be the return type of your calculation for example it might be 'Number'
You have to use Value Type equals your
OutputType rather than
Calculated in CAML query.
// This will not work >> <Value Type='Calculated'>my value</Value> // Following will work <Where> <Contains> <FieldRef Name='FullName' /> <Value Type='Text'>my value</Value> </Contains> </Where>
Read this link: CAML Query on Calculated Fields
I used the
FieldInternalName instead of the custom name of the field to make the Ronak Patel's solution working.
Who could not make it work:
The caluclated SharePoint field also has
FieldInternalName which is generated at the first time when the field is created.
Once the field is renamed then the
FieldName is changing accordingly, but the
FieldInternalName not. You can get the calc field
FieldInternalName from the display form by F12 - developer tool selecting calculated field element
td#SPFieldCalculated as this field type is not visible on the New or Edit Forms.
This is the simplest explanation that should help.