  Let $a\leq b$ be two positive integers. We say that a graph $G$ has all
$[a,b]$-factors if it has an $h$-factor for every function $h: V(G)\rightarrow
\mathbb{Z}^+$ such that $a\le h(v) \le b$ for all $v\in V(G)$ and $\sum_{v\in
V(G)}h(v)\equiv 0\pmod 2$, and has all fractional $[a,b]$-factors if it has a
fractional $p$-factor for every $p: V(G) \rightarrow \mathbb{Z}^+$ such that
$a\le p(v)\le b$ for all $v\in V(G)$. In this paper, we provide tight spectral
radius conditions for graphs having all $[a,b]$-factors ($3\leq a<b$) and all
fractional $[a,b]$-factors ($1\leq a<b$), respectively.
