I have one field of the student in database and I have to pass two rules in it
Classes 1-9 will only have 1 book for 1 week and
Classes 10-12 will have 2 books for 2 weeks.
How can I do that?

6 Years
Discussion Span
Last Post by lolafuertes

With only one filed, you only can add the text explaining the rule, IE:
Here, I used the ; sign to separate concepts, I used the : sign to separate Identifiers from their values and used the - sign to separate the bounds.

You can create the filed content easely by concatenating the right words, separators and values.

You can 'decript' the field using the string Split() function 3 times. The first using the ; as separator to get the Keywords and the values, each in a separate string (3 strings in this case).

The second, for each KeywordAndValue string obtained, you can use the Split() function with the : as separator to obtain 2 strings: the Keyword and the Value

The third, for those kywords that have bounded values, you can use the Split() function again with the - as separator, to obtain the lower and upper values.

Hope this helps

Edited by lolafuertes: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.