Check If Field Is Numeric In Where Clause?

liunx

Guest
How would I go about checking if a field value is numeric in the where clause of a mysql statement? The actual field is varchar but it is used to input transaction numbers which could include letters as well as numbers. One specific type of transaction, a Check, allows for a regular numeric check number as well as letters. Im trying to query that table to find only the check numbers that are completely numeric to be able to figure out what the next check will be.<br /><br />How would I form the where statement?<br /><br />Here is what I would think it would look like, except of course for the CheckNumber IS NUMERIC part.. but I want to get the higher check number already used.<br /><br />SELECT CheckNumber FROM tblBankLedger WHERE (CheckNumber IS NUMERIC) ORDER BY CheckNumber DESC LIMIT 0,1<br /><br />Thanks!<br />-Jacques<!--content-->
 
Top