Re: IsNumeric Function Like MS SQL??
- From: "AndyW" <AndrewMWalker@xxxxxxxxxxxxxx>
- Date: 8 Feb 2006 03:41:46 -0800
Thanks Scott,
I may have found an alternative way of doing this, how does this look:
Select case when MyVarCharField is not null and MyVarCharField <> ''
then Cast(MyVarCharField as Decimal(11,3)) else cast(null as
decimal(11,3)) end as MyDecimalField From MyFunkyTable
I'm trying to do this blind as I don't have full time access to the
Progess server (the joys of this strange contract). This works with
the data I have in a MS SQL server DB, I'm assured that the data will
"always" be Null as Zero Lenght String or a number in this column.
Thanks for your help on this...
Andy
Scott Auge wrote:
In article <1139231409.515693.310900@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"AndyW" <AndrewMWalker@xxxxxxxxxxxxxx> wrote:
Hi
I'm new at this progress stuff so I'm hoping someone can help me.
In MS SQL server we have a functions called IsNumeric and IsDate.
These allow you to evaluate data before processing it.
We have a DB where everything is stored as VarChar fields (I'm told
this is for good reason)
They lied. You're stuck working with screwy data so prepare to deal
with screwy ways to work with it.
What I'm trying to do is convert these VarChars to their correct data
types when I select them. In SQL Server I'd do this:
Select Case When IsNumeric(myVarCharField)= 1 then Cast(myVarCharField
as Decimal(11,3) ) else Cast(Null as Decimal(11,3) ) end As
MyDcecimalField From MyTable.
You got to table scan it and then decide if you want it or not.
FOR EACH MyTable NO-LOCK:
IF YourFunction(MyTable.A) THEN DO: ...
END. /* FOR EACH MyTable */
We're using Progress 9, can anyone tell me how to convert my MS SQL so
that it works with this version please.
I don't think so dude. There are resources to change it into MySQL and
PostgreSQL databases though.
Thanks
Andy
You should put down what version of Progress you are using also as well
as operating system.
--
.
- Follow-Ups:
- Re: IsNumeric Function Like MS SQL??
- From: Steve Foley
- Re: IsNumeric Function Like MS SQL??
- References:
- IsNumeric Function Like MS SQL??
- From: AndyW
- Re: IsNumeric Function Like MS SQL??
- From: Scott Auge
- IsNumeric Function Like MS SQL??
- Prev by Date: Re: IsNumeric Function Like MS SQL??
- Next by Date: Re: IsNumeric Function Like MS SQL??
- Previous by thread: Re: IsNumeric Function Like MS SQL??
- Next by thread: Re: IsNumeric Function Like MS SQL??
- Index(es):
Relevant Pages
|
|