Click to See Complete Forum and Search --> : Retrieve zip code where # of digits is greater than 5


zombie_man23
June 29th, 2005, 11:38 AM
I need the g.zip zip codes where the zip code has 9 digits. I know I need to use the count function, but I'm not sure how/where to place the function.

Many thanks in advance!!

visual basic code:select r.studentid, r.studentname, g.firstname, g.lastname, g.street, g.apartment, g.city, g.state, g.zip
from reg r, guardian g, family f
where
r.status = 'A' and r.language = 'EN'
and
r.grade between '04' and '12'
and
r.building not in (9764, 9765, 9767)
and
r.studentid = f.studentid
and
g.guardianid = f.guardianid
and
f.type = 'P'

Vaderman
June 29th, 2005, 03:07 PM
You can do the following :


SELECT columns
FROM <tableName>
WHERE LEN(TelephoneNumber) <= 9


Hope that helps.

Regards

John

zombie_man23
July 1st, 2005, 10:17 AM
thanks for the help. :)