Let KG be the group ring of a polycyclic by finite group G over a field K of characteristic zero. It is proved that if
e
=
∑
e
(
g
)
g
e = \sum e(g)g
is a nontrivial idempotent in KG then its trace
e
(
1
)
e(1)
is a rational number
r
/
s
,
(
r
,
s
)
=
1
r/s,(r,s) = 1
, with the property that for every prime divisor p of s, G has an element of order p. This result is used to prove that if R is a commutative ring of characteristic zero, without nontrivial idempotents and G is a polycyclic by finite group such that no group order
≠
1
\ne 1
is invertible in R, then RG has no nontrivial idempotents.