phpmyadmin no negative numbers

Is there a way in phpmyadmin to set a field in mysql to be 0 if the result is less than 0? I'm trying to determine how long to pay off my credit card. If the time remaining is a negative number i'd like that field to be 0. Any suggestions anyone?
Who is Participating?
Shinesh PremrajanConnect With a Mentor Technical ManagerCommented:
Define that field as unsigned integer.

Hope this helps
Frosty555Connect With a Mentor Commented:
You can create a view or a query with a custom column, set to something like

IF(myfield>0,myfield,0) AS myfieldnonegative

then when you select from that view, or execute that query, the resulting recordset will have a column "myfieldnonegative" which will be the result you're looking for.
Ray PaseurCommented:
"...  if the result is less than 0?"

If what result is less than zero?
gatormrr3Author Commented:
The code worked as well but the unsigned method was simpler and more error proof. Thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.