Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Greater and Less Than.

$
0
0
So part of my assignment, i've been told to 'show the first and last name of each employee who is paid more than X but less than Y'

The closest I've gotten in LINQ/SQL is

var emps = 
from e in Employees
let pop = from x in Employees where x.FirstName == "Luis" && x.LastName == "Popp" select x.Salary
let hun = from x in Employees where x.FirstName == "Alexander" && x.LastName == "Hunold" select x.Salary
where e.Salary > pop && e.Salary < hun
select e;




Unfortunately that gives an issue with.

Operator '>' cannot be applied to operands of type 'decimal?' and 'System.Linq.IQueryable<decimal?>'

Operator '<' cannot be applied to operands of type 'decimal?' and 'System.Linq.IQueryable<decimal?>'



In retrospect I should've put this in the .NET forum.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>