Re: SQL question

2007-04-03 Thread Ryan Stille
I wrote a blog post concerning this a while back: http://www.stillnetstudios.com/2007/01/20/comparing-dates-without-times-in-sql-server/ Hope that helps. -Ryan Chad Gray wrote: > I am using MS SQL and have a field with data type DateTime. > > I want to find all records with the day 4/2/2007? > >

RE: SQL question

2007-04-03 Thread Che Vilnonis
How about you simply use WHERE dateCreated = '4/2/2007' Basically, lose the padding zeros. ~Che -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 9:59 AM To: CF-Talk Subject: SQL question I am using MS SQL and have a field with data type DateTi

Re: SQL DatePart function not working in ...

2007-04-02 Thread Charlie Griefer
On 4/2/07, Kevin Bales <[EMAIL PROTECTED]> wrote: > > if it's not in pound signs, CF won't think that it "owns" the function. > > > > can you paste the code you're using and specify how it "does not work > > in cfquery"? > > -- > > Charlie Griefer > > > My SQL looks like this > > SELECT * > FRO

Re: SQL DatePart function not working in ...

2007-04-02 Thread Kevin Bales
> if it's not in pound signs, CF won't think that it "owns" the function. > > can you paste the code you're using and specify how it "does not work > in cfquery"? > > > -- > Charlie Griefer My SQL looks like this SELECT * FROM items WHERE DatePart("",itemDate)='1933' - Kevin ~~

Re: SQL DatePart function not working in ...

2007-04-02 Thread Charlie Griefer
On 4/2/07, Kevin Bales <[EMAIL PROTECTED]> wrote: > I am trying to use the DatePart() function as part of a normal SQL query > using Access DB. The SQL statement is formatted correctly to extract a month > from a date field in the DB, and the SQL tests fine in Access. However, it > does not wo

RE: SQL Question

2007-04-02 Thread Leitch, Oblio
On what engine? If this is MSSQL, try running the query tuning advisor. There maybe some updates to indexes or statistics that will speed it up. -Original Message- From: Jerry Barnes [mailto:[EMAIL PROTECTED] Sent: Monday, April 02, 2007 12:22 PM To: CF-Talk Subject: OT: SQL Question Th

RE: SQL Question

2007-04-02 Thread Adrian Lynch
Wold moving the M.i_recid IS NULL to the JOIN help? SELECT F.pid, F.acrostic, F.recid, F.recordthread, F.aed_onset, F.d_form FROM vfrm_sae F LEFT OUTER JOIN v_sae_jna_mr M ON F.recordthread = M.i_recordThread AND M.i_recid

RE: SQL "Like"

2007-03-30 Thread Steve Milburn
Correct - I should have stated that in my original email. Thanks for the clarification. -Original Message- From: Jim Wright [mailto:[EMAIL PROTECTED] Sent: Friday, March 30, 2007 3:48 PM To: CF-Talk Subject: Re: SQL "Like" Steve Milburn wrote: > T-SQL will return every r

Re: SQL "Like"

2007-03-30 Thread Jim Wright
Steve Milburn wrote: > T-SQL will return every record in this case. % is a placeholder for any > characters, so your query would essentially tell the database "where x = any > pattern of characters" and would return everything. if there are no NULLs in x.

RE: SQL "Like"

2007-03-30 Thread Steve Milburn
T-SQL will return every record in this case. % is a placeholder for any characters, so your query would essentially tell the database "where x = any pattern of characters" and would return everything. You could just run a query with that syntax in Query Analyzer or Management Studio and see for y

Re: SQL "Like"

2007-03-30 Thread Bryan Stevenson
You should only conditionally use that clause if the arg has a length IMHO ;-) I suspect it will either return ALL records or chokeneither I suspect is what you want ;-) .and run or not...it's sloppy SQL Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Ed

Re: SQL Question?

2007-03-29 Thread Paul Hastings
Doug Brown wrote: > Ok, so if my data will only be supporting the English language I should just > use varhcar or char since n uses 2 bytes for one character. Correct? never say "never". unless you're going to be dealing in TB of data, better safe than sorry.

Re: SQL Question?

2007-03-29 Thread Jochem van Dieten
Doug Brown wrote: > I understand several things about SQL when it comes to getting information > out of it, but never really have understood which data types to use for what > specific data. I know what ones suppose to hold what kind of data as far as > integer data, character data, monetary data,

RE: SQL Question?

2007-03-29 Thread Ben Forta
rsday, March 29, 2007 4:22 PM To: CF-Talk Subject: RE: SQL Question? I believe so... -Original Message- From: Doug Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 4:03 PM To: CF-Talk Subject: RE: SQL Question? Ok, so if my data will only be supporting the English language I s

RE: SQL Question?

2007-03-29 Thread Che Vilnonis
I believe so... -Original Message- From: Doug Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 4:03 PM To: CF-Talk Subject: RE: SQL Question? Ok, so if my data will only be supporting the English language I should just use varhcar or char since n uses 2 bytes for one

RE: SQL Question?

2007-03-29 Thread Doug Brown
Ok, so if my data will only be supporting the English language I should just use varhcar or char since n uses 2 bytes for one character. Correct? Doug -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 1:58 PM To: CF-Talk Subject: RE

RE: SQL Question?

2007-03-29 Thread Che Vilnonis
I've always read that you use nvarchar for multilingual data. Keep in mind, nvarchar takes up twice as much space in the db since it makes an alotment for languages that have extended characters. ~C -Original Message- From: Doug Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2

RE: SQL Login Faliure

2007-03-15 Thread Robert Rawlins - Think Blue
standard email with a copy of the logs and the offending IP's. Has anyone done something like this before? Thanks, Rob -Original Message- From: Dana Kowalski [mailto:[EMAIL PROTECTED] Sent: 14 March 2007 18:17 To: CF-Talk Subject: Re: SQL Login Faliure a decent reference from mic

Re: SQL Server Syntax - Converting this CF Code

2007-03-14 Thread Andrew Peterson
Thanks - let me try that - a lot cleaner than I thought it would be. ~| Upgrade to Adobe ColdFusion MX7 The most significant release in over 10 years. Upgrade & see new features. http://www.adobe.com/products/coldfusion?sdid=RVJR

Re: SQL Server Syntax - Converting this CF Code

2007-03-14 Thread Jim Wright
Andrew Peterson wrote: > Hi, > > I'd like to see how this is done, even though it is not necessary and I like > my ColdFusion thank you very much. Can someone give me a general idea of how > this code would look in SQL Server? It takes literally 5 minutes to write in > CF; but for me to put it

Re: SQL Login Faliure

2007-03-14 Thread Dana Kowalski
a decent reference from microsoft on securing SQL Server: http://msdn2.microsoft.com/en-us/library/aa302434.aspx (I was looking for it before but my bmarks have become unwieldy :o ) ~| ColdFusion MX7 by AdobeĀ® Dyncamically transf

Re: SQL Login Faliure

2007-03-14 Thread Gareth Hughes
I'll second that. IPSec can be complicated when you first set it up but is very flexible. - Original Message - From: "Jochem van Dieten" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Wednesday, March 14, 2007 4:23 PM Subject: Re: SQL Login Faliure Robert Raw

RE: SQL Login Faliure

2007-03-14 Thread Robert Rawlins - Think Blue
Thanks Jochem, I'll give that a go this afternoon. Rob -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: 14 March 2007 16:24 To: CF-Talk Subject: Re: SQL Login Faliure Robert Rawlins - Think Blue wrote: > > Is there a method for closing the server

Re: SQL Login Faliure

2007-03-14 Thread Jochem van Dieten
Robert Rawlins - Think Blue wrote: > > Is there a method for closing the server so it only receives connections > through the local server, It's only 2 or 3 of my CF apps that use it. Set an IPSec policy. Jochem ~| ColdFusion M

RE: SQL Login Faliure

2007-03-14 Thread Robert Rawlins - Think Blue
C and us the admin tool live on the box. Is there a method for closing the server so it only receives connections through the local server, It's only 2 or 3 of my CF apps that use it. Thanks, Rob -Original Message- From: Dana Kowalski [mailto:[EMAIL PROTECTED] Sent: 14 March 2007 14

RE: SQL Login Faliure

2007-03-14 Thread Robert Rawlins - Think Blue
Also, 'Kowalski' is a VERY cool name! :-D Rob -Original Message- From: Dana Kowalski [mailto:[EMAIL PROTECTED] Sent: 14 March 2007 14:30 To: CF-Talk Subject: Re: SQL Login Faliure are you on a co-locate, home network, virtual hosting etc? Normally I would just put blocks at

Re: SQL Login Faliure

2007-03-14 Thread Dana Kowalski
are you on a co-locate, home network, virtual hosting etc? Normally I would just put blocks at the router/firewall level to not allow the SQL machine (if its seperate form the web server) to communicate to anything outside the domain, or more specifically only to the web server (depending on yo

Re: SQL Median Value

2007-03-12 Thread Richard White
thank kris, the problem i am having is that all the information i find is always centered around getting a median using every single row in the table. except i have groups of data in the table and want to work out a median for each group. the group is identified by 4 different columns (the 5th c

Re: SQL Median Value

2007-03-12 Thread Kris Jones
Hi Richard, Take a look at this post that I found on tek-tips: http://www.tek-tips.com/faqs.cfm?fid=4751 Cheers, Kris > Hi, i am using ms sql server and need to implement get the median of a set of > values. i have looked all over the web and cant find a simple explanation. > > i would apprecia

RE: SQL - slightly OT

2007-03-10 Thread Pete
age- From: Peter Boughton [mailto:[EMAIL PROTECTED] Sent: Sunday, 11 March 2007 10:03 AM To: CF-Talk Subject: Re: SQL - slightly OT You need brackets around the ORs, otherwise it'll only join correctly on the first condition, and not the second two: SELECT * FROM tbl_meddelregos m, tbl_mdconfre

RE: SQL - slightly OT

2007-03-10 Thread Sandra Clark
If I understand you correctly select * from tbl_meddelregos m, tbl_mdconfregoptions r where m.confregoptionid = r.confregoptionid and ( m.confregoptionid = 1 or m.confregoptionid = 6 or ) AND cocktailparty > 0 order by lastn

Re: SQL - slightly OT

2007-03-10 Thread Peter Boughton
You need brackets around the ORs, otherwise it'll only join correctly on the first condition, and not the second two: SELECT * FROM tbl_meddelregos m, tbl_mdconfregoptions r WHERE m.confregoptionid = r.confregoptionid AND (m.confregoptionid = 1 OR m.confregoptionid = 6 OR cocktailparty

Re: SQL Server Database connection

2007-03-08 Thread Andrew Scott
Is it MS SQL 200 or MS SQL 2005? If 2005, the tcp/ip port 1433 is not switched on by default. On 3/9/07, Paul Dormody <[EMAIL PROTECTED]> wrote: > > I have looked at the Adobe help files and Forta's blog about setting up > a MS SQL datasource in CF MX 7. I have followed all of the suggestions >

Re: SQL Server DSN, text data type, CLOB is required?

2007-03-07 Thread Jacob Munson
> Long Text Buffer - The default buffer size, used if Enable Long Text > Retrieval(CLOB) is not selected. The default value is 64000 bytes. Oh, 64,000 chars should be plenty. Thanks guys. -- My Sites: http://www.techfeed.net/blog/ http://www.cfquickdocs.com/ http://cfformprotect.riaforge.org/

RE: SQL Server DSN, text data type, CLOB is required?

2007-03-07 Thread Dave Watts
> A co-worker of mine just told me that in order to use the > text data type in SQL Server, you have to enable CLOB and > BLOB in the data source in CFAdmin. Is this true? I need to > use the text data type because my users potentially could > enter a large amount of text (> 8000 chars). Str

Re: SQL Server DSN, text data type, CLOB is required?

2007-03-07 Thread Gareth Hughes
You don't have to enable clob to use text or ntext data types but if you don't then CF will crop any input to those fields that exceeds a certain length. I can't remember what the length is that CF crops at but I have experienced this. Not sure about blob. - Original Message - From: "

Re: SQL Server DSN, text data type, CLOB is required?

2007-03-07 Thread Matt Quackenbush
I'm not an expert, but I've been using 'text' and/or 'ntext' in SQL Server for years and have never done that, so I'm going to say no, that's not true. Matt A co-worker of mine just told me that in order to use the text data > type in SQL Server, you have to enable CLOB and BLOB in the data > s

RE: SQL Licensing Question

2007-03-06 Thread Dave Watts
> We are looking to buy SQL Server 2005 Workgroup. Seems more > than enough omph for complex web databases behind a CF Server. > So, I am a little confused by CALsthey state for every user that > directly connects needs a CAL...but is a web connection to a > CF server calling back to tha

RE: SQL Licensing Question

2007-03-06 Thread Dave Watts
> We are looking to buy SQL Server 2005 Workgroup. Seems more > than enough omph for complex web databases behind a CF Server. > So, I am a little confused by CALsthey state for every user that > directly connects needs a CAL...but is a web connection to a > CF server calling back to tha

Re: SQL for Access vs MySQL

2007-03-06 Thread Jochem van Dieten
Jim Wright wrote: > Pete wrote: >> >> They have a piece of code: >> >> select * >> into visaudactvols >> from visualauditrecs > > I don't believe MySQL supports this use of INTO. You can use: > INSERT INTO visaudactvols(somecolumn) > SELECT somecolumn FROM visualauditrecs > > but the table will

Re: SQL for Access vs MySQL

2007-03-06 Thread Jim Wright
Pete wrote: > Hi > > Hoping someone might be able to assist - its 4am and I have just been called > by a client coz their system crashed. They have just moved from using an > Access DB to MySQL. > > They have a piece of code: > > select * > into visaudactvols > from visualauditrecs > I don't

RE: SQL for Access vs MySQL

2007-03-06 Thread Ben Forta
That's because MySQL does not support SELECT INTO for tables, only external files and variables, so MySQL thinks your destination is a variable and is complaining that it does not exist. You may want to use INSERT SELECT instead. http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-select-into-table.h

Re: SQL for Access vs MySQL

2007-03-06 Thread Josh Nathanson
Take a look at this page for the proper INTO syntax. May change depending on which version of mysql you're using. It looks like you have to do something like INTO @visaudactvols if you're trying to use a variable. http://dev.mysql.com/doc/refman/4.1/en/select.html -- Josh - Original Mess

RE: SQL for Access vs MySQL

2007-03-06 Thread Ian Skinner
Are you sure your Mysql DBMS understands the 'INTO' SQL command. I have not seen that used much and do not know how universal it is among database systems. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Sudoku |

Re: SQL Enterprise Manager equivalent for 2005

2007-02-26 Thread Mike Little
thanks heaps for the advice guys. i am currently downloading the ems manager lite suggested by mike. looks right up my alley. cheers mike >There is a free tool for SQLServer2005 at >http://sqlmanager.net/products/mssql/manager/. > >It's called EMS SQLManager Lite. > >The "Lite" part means it d

Re: SQL Enterprise Manager equivalent for 2005

2007-02-25 Thread Mike Kear
There is a free tool for SQLServer2005 at http://sqlmanager.net/products/mssql/manager/. It's called EMS SQLManager Lite. The "Lite" part means it doenst have some features on it, but nothing that would worry us for what we do. The bits taken out are for professional DBAs and what's left is fin

RE: SQL Enterprise Manager equivalent for 2005

2007-02-24 Thread Coldfusion
If you want a GUI tool that will interface (connect and more) to MS-SQL 7, 2000, 2005, as well as MySQL, SyBase, Oracle, etc... Try Aqua Data Studio from Aqua Fold http://www.aquafold.com -Original Message- From: Mike | NZSolutions Ltd [mailto:[EMAIL PROTECTED] Sent: Saturday, February

Re: SQL Enterprise Manager equivalent for 2005

2007-02-24 Thread Stan Winchester
Get the Microsoft Action Pack you get a ton of Microsoft software for only $299 per year, Including SQL Server 2005. https://partner.microsoft.com/us/40013779 Enrollment is open to: Resellers, Technology Consultants, Value-added Technology Partners, System Integrators, System Builders, and best

Re: SQL Enterprise Manager equivalent for 2005

2007-02-24 Thread Rick Root
SQL Server Management Studio combines the features of Enterprise Manager *AND* Query Analyzer in a single tool, which is great. You do not need a full license, you can install the client software locally - just download the trial of SQL 2005 and install only the client software. Rick On 2/24/07

Re: SQL Enterprise Manager equivalent for 2005

2007-02-24 Thread Steve Milburn
I'm not sure this came through properly the first time so here it goes again... sorry if this is a duplicate post. In SQL Server 2005, the Enterprise Manager has been replaced with the SQL Server Management Studio. There is a version called SQL Server Management Studio Express Edition that is

Re: SQL Enterprise Manager equivalent for 2005

2007-02-24 Thread Steve Milburn
Mike | NZSolutions Ltd wrote: > Hi guys, > > Did a bit of research on this topic, but a little confused. > > What should I be using as an enterprise manager equivalent for sql > server 2005 (hosted at my webhost). I wish to be able to connect to the > db and create/organise tables - including reord

Re: SQL next and previous

2007-02-22 Thread Robertson-Ravo, Neil (RX)
14:12 2007 Subject: Re: SQL next and previous Add something like this into your where clause WHERE clientID = OR clientID = OR clientID = and then sort by clientID. Then use array notation to access the parts of the query you want... getClient.clientID[1] will be any client before getClient.

Re: SQL next and previous

2007-02-22 Thread David Gardner
Add something like this into your where clause WHERE clientID = OR clientID = OR clientID = and then sort by clientID. Then use array notation to access the parts of the query you want... getClient.clientID[1] will be any client before getClient.clientID[2] will be the selected one getClien

Re: sql query help

2007-02-05 Thread Mik Muller
This is how I'm doing it for now... select count(*) as dt , left(datetime,11) as datetime from sitelog where datepart(year,datetime) = '#theyear#' and datepart(month,datetime) = '#themonth#' and datepart(year,datetime) = '#listFirst(url.datestat,"/")#' and datepart(month,datetime

Re: sql query help

2007-02-05 Thread Jim Wright
Mik Muller wrote: > > select left(datetime,11), count(*) as dt > from sitelog > where datetime >= '2007-02-03 00:00' > group by left(datetime,11) > order by left(datetime,11) desc > > > Well, now that I look at it, the order by is ordering by "jan 1 2006"

Re: SQL QUestion

2007-02-01 Thread Bruce Sorge
Damn! Always the simple shit that gets me. Thanks. On 2/1/07, Jochem van Dieten <[EMAIL PROTECTED]> wrote: > > Bruce Sorge wrote: > > OK, I figured it out pretty much. So now I have this: > > > > CREATE TABLE #tempduplicatedata > > ( > > Code NVARCHAR(20) > > ) > > > > > > --Identify and save dup

Re: SQL QUestion

2007-02-01 Thread Jochem van Dieten
Bruce Sorge wrote: > OK, I figured it out pretty much. So now I have this: > > CREATE TABLE #tempduplicatedata > ( > Code NVARCHAR(20) > ) > > > --Identify and save dup data into temp table > INSERT INTO #tempduplicatedata INSERT INTO #tempduplicatedata (code) > SELECT Code FROM Codes > GROUP

RE: sql question

2007-02-01 Thread Gaulin, Mark
You may want to recompile the sp... It may have been compiled before the "statistics" for the tables involved were updated. You could check the query plan of the sp vs. the query to see how they differ. (Not sure what db you are using...) Mark -Original Message- From: Tim Do [ma

RE: sql question

2007-02-01 Thread Brad Wood
How many records are coming back? How are you calling it? I have ran tests before for where running exec sp_name in side of a cfquery was faster than cfstoredproc. Just a thought. Also are you sure the stored proc is really taking 20 seconds to run OR is the CF page just taking 17 seconds to pr

Re: SQL QUestion

2007-02-01 Thread Paul Hastings
Bruce Sorge wrote: > I have a lot of duplicate information in a table. I know how to query to > find the dupes, but I am having problems with deleting them (there are > thousands). I tried this: create a clone of your table but make your "key" duplicated column as a unique key setting the index t

RE: SQL QUestion

2007-02-01 Thread Russ
I actually bloged about this earlier this month. See here: http://www.ruslansivak.com/index.cfm/2007/1/10/Deleting-duplicate-rows-from- SQL-Server Russ > -Original Message- > From: Bruce Sorge [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 01, 2007 12:26 PM > To: CF-Talk > Subject

Re: SQL QUestion

2007-02-01 Thread Bruce Sorge
OK, I figured it out pretty much. So now I have this: CREATE TABLE #tempduplicatedata ( Code NVARCHAR(20) ) --Identify and save dup data into temp table INSERT INTO #tempduplicatedata SELECT Code FROM Codes GROUP BY Code HAVING COUNT(Code) > 1 --Confirm number of dup rows SELECT @@ROWCOUNT AS '

Re: SQL QUestion

2007-02-01 Thread Jim Wright
Bruce Sorge wrote: > I have a lot of duplicate information in a table. I know how to query to > find the dupes, but I am having problems with deleting them (there are > thousands). I tried this: > > DELETE > FROM CODES > WHERE Code = > (SELECT Code, > COUNT(Code) AS NumOccurrences > FROM Codes > G

RE: SQL QUestion

2007-02-01 Thread Adrian Lynch
Without looking too hard, would using a TOP 1 in the sub select work? -Original Message- From: Bruce Sorge [mailto:[EMAIL PROTECTED] Sent: 01 February 2007 17:26 To: CF-Talk Subject: SQL QUestion I have a lot of duplicate information in a table. I know how to query to find the dupes, but

Re: SQL QUestion

2007-02-01 Thread Doug Brown
Bruce, One way to accomplish this is to query your (unique) records and populate another table with the same structure with that data. Once it is done, then you can re-populate that table from the table you created. Hope that makes sense. Doug B. - Original Message - From: "Bruce Sorg

Re: SQL insert issue with indexes

2007-01-30 Thread Scott Weikert
Gaulin, Mark wrote: > Ok, so how is the varchar field defined? If it is over that limit you > mentioned earlier (1000 or so?) then that's the problem. Basically, SQL > Server would be complaining only when the data to index actually was too > big. > > I suspect that's the issue - in this part

RE: SQL insert issue with indexes

2007-01-30 Thread Gaulin, Mark
ght not even experience a performance difference using the shorter index. (I've never done that before in real use but I was just able to define a table and index that way.) Mark -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 30, 2007 3:21 P

Re: SQL insert issue with indexes

2007-01-30 Thread Scott Weikert
Gaulin, Mark wrote: > There must be other indexes on this table that include the text fields. > Check in SQL Enterprise Manager. > Did. There's four fields: The main identity field (PK) Two int fields referencing IDs in other tables (with indexes, but no foreign key/relationships set up) One v

RE: SQL insert issue with indexes

2007-01-30 Thread Gaulin, Mark
There must be other indexes on this table that include the text fields. Check in SQL Enterprise Manager. Mark -Original Message- From: Scott Weikert [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 30, 2007 1:03 PM To: CF-Talk Subject: SOT: SQL insert issue with indexes In my ma

Re: SQL order by

2007-01-25 Thread Qasim Rasheed
> dealing with. > > Thanks! > > > -Original Message- > From: Jim Wright [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 25, 2007 10:18 AM > To: CF-Talk > Subject: Re: SQL order by > > Jim Wright wrote: > > I should point out one issue with the way

RE: SQL order by

2007-01-25 Thread Chad Gray
Subject: Re: SQL order by Jim Wright wrote: > I should point out one issue with the way I did it...the isnumeric > function is not perfect, and will resolve to true things that can't be > converted to INT...case in point... > > IsNumeric('1,0.') = 1 > CAST('

Re: SQL order by

2007-01-25 Thread Jim Wright
Jim Wright wrote: > I should point out one issue with the way I did it...the isnumeric > function is not perfect, and will resolve to true things that can't be > converted to INT...case in point... > > IsNumeric('1,0.') = 1 > CAST('1,0.' AS INT) throws an error > and further, you need to look

Re: SQL order by

2007-01-25 Thread Jim Wright
I should point out one issue with the way I did it...the isnumeric function is not perfect, and will resolve to true things that can't be converted to INT...case in point... IsNumeric('1,0.') = 1 CAST('1,0.' AS INT) throws an error ~~

RE: SQL order by

2007-01-25 Thread Chad Gray
have never used WHEN, THEN, ELSE, END in SQL. -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 9:51 AM To: CF-Talk Subject: RE: SQL order by Case isn't a function. It's a flow control statement. Just like doing a cfswitch stateme

Re: SQL order by

2007-01-25 Thread Teddy Payne
in CF. > > -Original Message- > From: Chad Gray [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 25, 2007 8:52 AM > To: CF-Talk > Subject: RE: SQL order by > > Thanks Jim! That works great for me! > > I will have to look up CASE, I am not familiar with tha

RE: SQL order by

2007-01-25 Thread Andy Matthews
Case isn't a function. It's a flow control statement. Just like doing a cfswitch statement in CF. -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 8:52 AM To: CF-Talk Subject: RE: SQL order by Thanks Jim! That works great for m

Re: SQL order by

2007-01-25 Thread Teddy Payne
> > > > -Original Message- > From: Andy Matthews [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 25, 2007 9:22 AM > To: CF-Talk > Subject: RE: SQL order by > > > SELECT yourcolumn, 0+REPLACE(SUBSTRING_INDEX(yourcolumn,' ',1),',','

RE: SQL order by

2007-01-25 Thread Chad Gray
Thanks Jim! That works great for me! I will have to look up CASE, I am not familiar with that function. Thanks again! -Original Message- From: Jim Wright [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 9:26 AM To: CF-Talk Subject: Re: SQL order by Chad Gray wrote: >

RE: SQL order by

2007-01-25 Thread Chad Gray
Thanks Andy, I am using MS SQL and don't have substring_index. Is there a MS SQL function similar? -Original Message- From: Andy Matthews [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 9:22 AM To: CF-Talk Subject: RE: SQL order by SELECT yourcolumn, 0+RE

Re: SQL order by

2007-01-25 Thread Teddy Payne
Or you could do that =) Either you update the data which allows better sorting or you inline query it with aggregate solutions and the data remains unsorted. It is a philosophical choice. I like to keep good indexes, so I perform a lot of data scrubbing to avoid complex queries for other team me

Re: SQL order by

2007-01-25 Thread Teddy Payne
If you keep it as a string column, you cannot avoid this. The only way you can sort it correctly is to pad the single digits with a leading 0. This will force: 01 02 03 . update tblFoo set columnFoo = '0' + columnFoo where cast(columnFoo AS integer) < 10 ^---MS SQL solution. Te

Re: SQL order by

2007-01-25 Thread Jim Wright
Chad Gray wrote: > > I cannot switch it to an integer field because there will be some text also. > > Any way to accomplish this? > maybe something like... SELECT thefield FROM foo ORDER BY CASE WHEN IsNumeric(thefield)=1 THEN CAST(thefield AS INT) ELSE 0 END,thefield That should put the text

RE: SQL order by

2007-01-25 Thread Andy Matthews
SELECT yourcolumn, 0+REPLACE(SUBSTRING_INDEX(yourcolumn,' ',1),',','') AS sort FROM yourtable ORDER BY sort -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Thursday, January 25, 2007 8:13 AM To: CF-Talk Subject: SQL order by When you use ORDER BY in SQL on a text f

RE: SQL Server, querying between two DBs

2007-01-24 Thread Andy Matthews
I'm sure our dba has this done already. Thanks for pointing it out though/ -Original Message- From: James Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 24, 2007 5:08 AM To: CF-Talk Subject: RE: SQL Server, querying between two DBs > Our dba finally got out of his

RE: SQL Server, querying between two DBs

2007-01-24 Thread James Smith
> Our dba finally got out of his meeting. Turns out that not > only are they separate databases, but they're also on a > different server. > > So it's [server_name].databasename.dbo.tablename. This will work fine but remember to set up "linked servers" in Enterprise Manager or the cross-server

RE: SQL Server, querying between two DBs

2007-01-23 Thread Andy Matthews
lto:[EMAIL PROTECTED] Sent: Tuesday, January 23, 2007 3:35 PM To: CF-Talk Subject: Re: SQL Server, querying between two DBs Andy Matthews wrote: > I've got two DBs showing up in Enterprise Manager. I need to query > against both of them. In MySQL you can do this by simply prepending

Re: SQL Server, querying between two DBs

2007-01-23 Thread Jim Wright
Andy Matthews wrote: > I've got two DBs showing up in Enterprise Manager. I need to query against > both of them. In MySQL you can do this by simply prepending the db name to > the tablename like so: > > SELECT t1.id > FROM db1.t1 t1 > INNER JOIN db2.t1 t2 > ON t1.id = t2.fkID > Assuming t

RE: SQL Server, querying between two DBs

2007-01-23 Thread Dave Watts
> I've got two DBs showing up in Enterprise Manager. I need to > query against both of them. In MySQL you can do this by > simply prepending the db name to the tablename like so: > > SELECT t1.id > FROM db1.t1 t1 > INNER JOIN db2.t1 t2 > ON t1.id = t2.fkID > > How would you do this in Ent

Re: SQL Server, querying between two DBs

2007-01-23 Thread Robertson-Ravo, Neil (RX)
You use Query Analyser, Tools > Query Analyser (in SQL 2000). New Query in 2005. .. "This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information wh

Re: SQL Link error

2007-01-17 Thread Eric Haskins
VMware baby!! No honestly that is why I use VMWare on my Dev Server and my Laptop. At anytime I can spin up similar enviroments Linux,Win2k3, etc . Best 200.00 I spent :) Eric Haskins Web Systems Developer On 1/17/07, Bruce Sorge <[EMAIL PROTECTED]> wrote: > > Thanks Ben, > I will give that a

RE: SQL Link error

2007-01-17 Thread Dave Watts
> I am getting this error on my development laptop but not on > any other machine. I googled the problem but could not get > anything very useful. > > [Macromedia][SequeLink JDBC Driver][ODBC > Socket][Microsoft][ODBC SQL Server Driver]Optional feature > not implemented > > I am using CFMX 7

Re: SQL Link error

2007-01-17 Thread Bruce Sorge
Thanks Ben, I will give that a try when I get home. I just find it odd that on my test server at home and the production server, it I have no issues with this. It is only my laptop. The only difference in my laptop and the test and production servers is that the laptop is running Windows XP Profess

RE: SQL Link error

2007-01-17 Thread Ben Nadel
Bruce, I got that error what I was using CFQueryParam with CF_SQL_DATE. Apparently CF_SQL_DATE is not inherently supported. If you are using it, try switching over to CF_SQL_TIMESTAMP, which is supported by SQL Server. .. Ben Nadel Certified Advanced ColdFusion MX7 Developer

Re: SQL Join & Data group output

2007-01-17 Thread Richard Cooper
Thanks for both your code examples. I'm succesfully testing both out now, not sure yet which route I will pick though. Very useful, thanks again. R ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create

Re: SQL Server Import Help Needed

2007-01-17 Thread Richard Cooper
Is this a one off import? If yes, I've never had a problem pasting excel into access. From there it should be easier to import into sql server. ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 & MX7 integration & create pow

RE: SQL Server Import Help Needed

2007-01-16 Thread Dawson, Michael
I ran into this last year, but I forgot the exact cure. Try changing your ntext field to a varchar large enough to hold your text. Then, once imported, change the varchar back to ntext. If that doesn't work, save the spreadsheet as a delimited text file and then import that. I believe the probl

Re: SQL Join & Data group output

2007-01-16 Thread Jim Wright
There are probably many ways to do this, but one thing you might find useful is to make use of a CROSS JOIN in your query...that way you can return one record for each combination of tbl1ID and service, and then use a LEFT JOIN to determine if there is a match in Table 2...something like... SE

Re: SQL Join & Data group output

2007-01-16 Thread Teddy Payne
Sorry for the delay. I had some deliverables and a few meetings. It was a fun little code challenge that I put on myself to finish it under 25 minutes. Teddy On 1/16/07, Teddy Payne <[EMAIL PROTECTED]> wrote: > > Richard, > I did not like the TSQL dynamic SQl that I created. I always hate > de

Re: SQL Join & Data group output

2007-01-16 Thread Robertson-Ravo, Neil (RX)
o: CF-Talk Sent: Tue Jan 16 21:49:57 2007 Subject: Re: SQL Join & Data group output Richard, I did not like the TSQL dynamic SQl that I created. I always hate defeating an execution plan. Here is a CF way: select entryID , entryCol1 from dbo.tblEntry select e.entryID ,

Re: SQL Join & Data group output

2007-01-16 Thread Teddy Payne
Richard, I did not like the TSQL dynamic SQl that I created. I always hate defeating an execution plan. Here is a CF way: select entryID , entryCol1 from dbo.tblEntry select e.entryID , s.serviceCol1 from dbo.tblEntry e join dbo.tblEntryService es on e.entryID = es.en

<    4   5   6   7   8   9   10   11   12   13   >