Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

Two conditions in IQueryable

How to correct this two conditions?
        public IQueryable<SalesRecord> GetSalesRecordsBranchId(int branchid, string sDate)
        {
            return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid);
        }
I want to insert sDate something like this... Where so.TheDate == sDate

Please help I don't know how to combine this two conditions...
0
Whing Dela Cruz
Asked:
Whing Dela Cruz
  • 2
1 Solution
 
gopaltaydeCommented:
return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid && so.TheDate == sDate );
0
 
Whing Dela CruzAuthor Commented:
Hi! Thanks a lot.. I've got it.. can I ask 1 more question?
What about if I put another conditions specifying  the range. example I want to view only the date between February 02, 2012 and March 01, 2012

        public IQueryable<SalesRecord> GetSalesRecordsBranchId(int branchid, string sDate, string xDate)
        {
            return this.ObjectContext.SalesRecords.Where(so => so.BranchID == branchid);
        }
 I want to set sDate and xDate as the range.. Thanks in advance..
0
 
Whing Dela CruzAuthor Commented:
Thank you so much..
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now