Did you get the email with the table I sent?

-----Original Message-----
From: Dave Phillips <[EMAIL PROTECTED]>
To: cf-newbie <[email protected]>
Sent: Wed, 29 Oct 2008 2:49 pm
Subject: RE: Numerical order of query results



Sheesh, this is nuts.  It should return 0 for '01DEMO' according to the sql
erver docs.
Let's take a look at the data and see if we can find another solution.
Dave
-----Original Message-----
rom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
ent: Wednesday, October 29, 2008 1:47 PM
o: cf-newbie
ubject: Re: Numerical order of query results
This seems to work as long as it doesn't encounter the 01DEMO account
umber.
  ORDER BY 
               
              (CASE WHEN isNumeric(a.ClCo) = 1 THEN 
              CONVERT(numeric(8), a.ClCo) 
              ELSE a.ClCo 
              END)
Then I get this error: 


he value "01DEMO" cannot be converted to a number 


ut, I think, logically, it should work anyway.  It seems to see 01DEMO as
umeric in the first statement, but then can't convert it to a number.
Thanks,
ewis

----Original Message-----
rom: Dave Phillips <[EMAIL PROTECTED]>
o: cf-newbie <[email protected]>
ent: Wed, 29 Oct 2008 2:04 pm
ubject: RE: Numerical order of query results

Yes, your parenthesis were correct.  You have to remember though...using
Numeric() in the SQL statement means you are using a COMPLETELY DIFFERENT
NCTION than the IsNumeric you use in an IF statement in ColdFusion.  It's
SQL Server function versus a ColdFusion function.
n any case, try the option I told you for Isnumeric() = 1.  Also, I did NOT
ceive the example of the data.  Don't know why, but it didn't come
rough.
ave
----Original Message-----
om: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
nt: Wednesday, October 29, 2008 12:31 PM
: cf-newbie
bject: Re: Numerical order of query results
i David,
  I thought that the data you mentioned was an example of how the data was
ing displayed and then how it should be displayed.  I sent that.  And, I
ink Option 1 included adding zeros, which will not always work, as I
plained.  I know that I can get IsNumbric() to work in an If statement,
t so far not in a query.  Did my query look like it was right?  Were the
renthisis in the right places?
hanks,
wis




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4116
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to