views:

27

answers:

1

Hi, I have a column of date datatype. The user may type in any date. I need to check in the code for unique year values in the column. Is there any C3 direct syantax is tere or I need to use CMAL query... Thanks in advance.

A: 

You have no other options, but to use CAML Query. To achieve better performance, do the following:

  1. Use CAML Query and specify RowLimit = 1 for better performance.
  2. If you must have unique year value, then that list data can be no way so huge that it would cause major performance implications unless you have other list data of different content types in list. If you do, don't forget to specify what content type are you querying in your query like <FieldRef Name="ContentTypeId"/><BeginsWith>0x...</BeginsWith>.
  3. Oh, and in queries ViewFields specify only that field you're interested in.

Just make as specific query as you can.

Janis Veinbergs

related questions