Does it matter where in the field the dash or period is found? For instance, does it have to start with a number or can it start with a negative sign? Can it end with a period or negative sign?
On Wed, Apr 20, 2011 at 8:28 AM, G Money <gm0n3...@gmail.com> wrote: > > The ISNUMERIC function in SQL Server returns a 1 on a field that contains a > single dash character ("-") or a single period character (".") > > Anyway, this causes issues, obviously, since a "-" or a "." can't be > converted to a number for use in calculations with other numeric values. > > We currently run this check to ensure there are no non-numeric characters > present, except for the dash (negative sign) or period (decimal point): > > PATINDEX('%[^0-9.-]%',myField) > 0. > > This works just fine. However, I need to modify it somehow to account for > the situation above. Put simply, i want to modify that expression to allow > for a dash or a period, but ONLY if those characters are submitted in > conjunction with at least ONE numeric value. > > TIA, > BG > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:336535 Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-community/unsubscribe.cfm