House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Search cf-newbie

July 04, 2009

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Home / Groups / ColdFusion Newbie (CF-Newbie)

Numerical order of query results

Author:
Dave Phillips
10/29/2008 02:08 PM

No.  Send it to me off-list.  It must not be going through the list server for some reason. Dave Did you get the email with the table I sent? 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: billingsly@aol.com [mailto:billingsly@aol.com] 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 <experiencedcfdeveloper@gmail.com> o: cf-newbie <cf-newbie@houseoffusion.com> 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: billingsly@aol.com [mailto:billingsly@aol.com] 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


Mailing Lists