Hi, i am working on a member database. I need to get all the registrations except the current week. I have a "week" field in my database.

This one is fine and echos all the records from week 1 to 8:

SELECT COUNT(*) FROM agents WHERE week < 9  and status = Active

But when it transfered to a 2 digit value it returns 0 result:

SELECT COUNT(*) FROM agents WHERE week < 10  and status = Active

I've been here for sometime to no avail.

Thanks a lot guys!

what is the use of COUNT(*).

SELECT COUNT(*) FROM agents WHERE week < 9  and status = Active

. why do u use count(*).

ok. i uderstood. you want to get total no rows.

SELECT COUNT(*) FROM agents WHERE (week < '9'  and status = 'Active'

. try like this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.