We help IT Professionals succeed at work.
Get Started

Linq Data Range

lulu50 asked
Last Modified: 2020-02-15

I need your help please!!!

 I want to say if the user enter in GroupTxt a range from 10 -30 the linq query will return the result within that range.

<select name="GroupListID" class="btn btn-default dropdown-toggle" id="GroupListID">
                            <option value="">Select an Option</option>
                                    <option value="3">Dx</option>
                                    <option value="5">Group ID</option>
                                    <option value="4">NPI</option>
                                    <option value="6">Plan Code</option>
                                    <option value="1">Px</option>

                         @Html.TextBoxFor(x => x.GroupTxt, new { @class = "form-control", @style = "width:100%" })

Open in new window

Table: RuleDetail
if (model.SelectedGroupID != null && model.GroupTxt != null)
                     list = list.Where(x => model.GroupTxt.Any(m => Equals(x.ConditionAttributesAndValues, m)));
                      // here I want to say 
                      //  and 
                      // and if the user enter a range in the textbox then filter all that are within the range.

Open in new window

ConditionAttributesAndValues is varchar(1000)

the data inside the ConditionAttributesAndValue looks like this:

<br> IF Dx = aa (299.00,<br>299.01,<br>299.80,<br>299.81,<br>299.90,<br>299.91,<br>99999)  <br> AND Dx Between Range (10 - 30) <br>(aa22)<br>"aa55"<br>

Open in new window

so is there a way to search for Dx range and see if what the user enter in the textbox is within the range in the database field called ConditionAttributesAndValue?
Watch Question
Distinguished Expert 2019
This problem has been solved!
Unlock 1 Answer and 21 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE