Re: SQL injection hack?

2007-08-06 Thread Rey Bango
Looks that way. Rey Rick King wrote: Hey all, I just received this email that is generated when there is an error on a site I built (www.woreitonce.com) ---E-MAIL Invalid data 1 and 1=convert(int,(select top 1 char(97)+admin_password

Re: SQL injection hack?

2007-08-06 Thread Rey Bango
Sorry didn't see your question at the bottom. One thing that will definitely help is using CFQUERYPARAM to enforce datatype checks on your conditional statements. http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-b20.htm Also, consider writing code that will strip out certain commands

RE: SQL injection hack?

2007-08-06 Thread Justin Scott
---E-MAIL Invalid data 1 and 1=convert(int,(select top 1 char(97)+admin_password from tbl_adminusers)) for CFSQLTYPE CF_SQL_INTEGER. brThe error occurred on line 30. -E-MAIL Is this a SQL

RE: SQL injection hack?

2007-08-06 Thread Damien McKenna
-Original Message- From: Rick King [mailto:[EMAIL PROTECTED] Sent: Monday, August 06, 2007 11:56 AM Subject: SQL injection hack? /Details.cfm ProdID=1%20and%201=convert(int,(select%20top%201%20char(97) %2badmin_password%20from%20tbl_adminusers)) IsNumeric and cfqueryparam are

Re: SQL injection hack?

2007-08-06 Thread jonese
Just an FYI to everyone else i've been at my current post for 3 years and we've had pro-active error monitoring (versus re reactive hey my site doesn't work) now for close to 2 years. Just in the recent weeks we started seeing basic SQL injection hacks on site we host. We never saw anything like

Re: SQL injection hack?

2007-08-06 Thread Rick King
Great info guys, thanks. ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648

Re: SQL injection hack?

2007-08-06 Thread Claude Schneegans
Just in the recent weeks we started seeing basic SQL injection hacks on site we host. Yes, I see more and more of these on my sites too. Of course, they cause an error thanks to CFQUERYPARAM, but they are filling my error log table with useless information. So I'm planning to detect them

RE: SQL injection hack?

2007-08-06 Thread Paul Vernon
on for my DB objects and turn it off where I feel it's not necessary. Paul -Original Message- From: jonese [mailto:[EMAIL PROTECTED] Sent: 06 August 2007 16:25 To: CF-Talk Subject: Re: SQL injection hack? Just an FYI to everyone else i've been at my current post for 3 years and we've

RE: SQL injection hack?

2007-08-06 Thread John Mason
[mailto:[EMAIL PROTECTED] Sent: Monday, August 06, 2007 12:01 PM To: CF-Talk Subject: RE: SQL injection hack? We've been seeing the exact same thing, basic SQL injection attacks all originating from China... It looks automated as they've spidered several sites we host using the exact same technique

Re: SQL injection hack?

2007-08-06 Thread Claude Schneegans
In CF 8 it's worth noting that the type checking can be turned off for performance gains. I guess this is a trade off... IMO, it is not only a trade off, it's kind of stupid... Where do you need performance? On the production server, but it is also there that you need security. One could

RE: SQL injection hack?

2007-08-06 Thread Andy Matthews
Thanks John...this is a great checklist. -Original Message- From: John Mason [mailto:[EMAIL PROTECTED] Sent: Monday, August 06, 2007 12:25 PM To: CF-Talk Subject: RE: SQL injection hack? You'll also see these automated scripts hitting other services like ftp, email, etc. You need

RE: SQL injection hack?

2007-08-06 Thread John Mason
PM To: CF-Talk Subject: RE: SQL injection hack? Thanks John...this is a great checklist. -Original Message- From: John Mason [mailto:[EMAIL PROTECTED] Sent: Monday, August 06, 2007 12:25 PM To: CF-Talk Subject: RE: SQL injection hack? You'll also see these automated scripts hitting other

Re: SQL injection hack?

2007-08-06 Thread Cutter (CFRelated)
Someone might have to test this out, but my cf8 admin only let's me disable the CFC Type Check (so it says), so cfqueryparam wouldn't/shouldn't be affected by this. Steve Cutter Blades Adobe Certified Professional Advanced Macromedia ColdFusion MX 7 Developer _

Re: SQL injection hack?

2007-08-06 Thread Rick King
Looks like using the Val() function did the trick. No more errors being generated :) Thanks Rick ~| Create robust enterprise, web RIAs. Upgrade to ColdFusion 8 and integrate with Adobe Flex

Re: SQL Question - seleting row sets

2007-07-19 Thread James Wolfe
There are a number of ways to do this. The typical way that I get this done is (im going to use your example of rows 31-50 for a total of 20 rows) SELECT TOP 20 * FROM [tableName] WHERE [primaryKeyField] not in ( SELECT top 30 [primaryKeyField] FROM [tableName] WHERE [criteriaField]

RE: SQL Server 2005 datasource - permissions

2007-07-13 Thread Dave Watts
I have a SQL Server database and I want to make it accessible to CF. I can connect successfully to the datasource in CFIDE using the sa account, but I cannot do the same using a New Login with SQL Server Authentication. The error I receive is Login failed for user 'theuser' which is

Re: SQL Server 2005 datasource - permissions

2007-07-13 Thread Andrew Peterson
I have a SQL Server database and I want to make it accessible I'll bet you actually have the incorrect password. There's nothing special you have to to create logins that you can use from CF. Try changing the password. Dave You are correct sir! Thank you. I do have a follow up question,

RE: SQL Server 2005 datasource - permissions

2007-07-13 Thread Dave Watts
You are correct sir! Thank you. I do have a follow up question, however. I'm curious - the password I was trying to use that was being rejected was a GUID created using CreateUUID(). Should/can such identifiers not be used as passwords in the CF Administrator? My thought was that you

RE: SQL Server 2005 Express on dual CPU machine?

2007-06-28 Thread Damien McKenna
To answer my own question: http://support.microsoft.com/default.aspx/kb/914278 Microsoft SQL Server 2005 Express Edition can only use one CPU, even if the computer has more than one CPU. So it can be installed on a multi-CPU machine, it'll just limit how it works. Perfect. Damien McKenna Web

RE: SQL to Retrieve One Record from Several Possible Records

2007-06-28 Thread Peterson, Chris
You could do multiple joins and check for null in your case statement. (this is assuming you have multiple addresses in a separate table with a primary key somehow relating to your main user database. In my example I am joining your pSeason file with the alias A to my theoretical pAddresses file

RE: SQL to Retrieve One Record from Several Possible Records

2007-06-28 Thread Dawson, Michael
-Talk Subject: RE: SQL to Retrieve One Record from Several Possible Records You could do multiple joins and check for null in your case statement. (this is assuming you have multiple addresses in a separate table with a primary key somehow relating to your main user database. In my example I am

Re: SQL to Retrieve One Record from Several Possible Records

2007-06-28 Thread Jim Wright
,CASE WHEN A.addr_type IS NOT NULL THEN A.myAddressField WHEN A.addr_type IS NULL AND B.addr_type IS NOT NULL THEN B.myAddressField WHEN A.addr_type IS NULL AND B.addr_type IS NULL THEN C.myAddressField ELSE 'No Address Found' END AS SeasonAddress

Re: SQL to Retrieve One Record from Several Possible Records

2007-06-28 Thread Alan Rother
Just to offer an alternate. Instead of those time consuming case statements and joins, you could just add a new table to assign a sort order value to each of the Types, such as you said the table would look like this 1 - RMA 2 - LOC 3 - H Where the numeric value would be the type's ordering ID

RE: SQL to Retrieve One Record from Several Possible Records

2007-06-28 Thread Gaulin, Mark
, but sometimes that's enough. - Mark From: Alan Rother [mailto:[EMAIL PROTECTED] Sent: Thu 6/28/2007 5:47 PM To: CF-Talk Subject: Re: SQL to Retrieve One Record from Several Possible Records Just to offer an alternate. Instead of those time consuming case

RE: SQL Help, please ...

2007-06-27 Thread Brad Wood
Let me get this straight, you want a report to summarize the number of installs by date and client. So client 1 ran 3 installs on 6/1 and 2 installs on 6/2. I believe you simply need to group by hostname, and then date and then use an aggregate function (count()) to add up the records in between

Re: SQL Help, please ...

2007-06-27 Thread Jochem van Dieten
[EMAIL PROTECTED] wrote: HostName, iDate, Package client1, 2007-06-01, Update1 client1, 2007-06-01, Update2 client1, 2007-06-01, Update3 client1, 2007-06-02, Update5 client1, 2007-06-02, NewApp client2, 2007-06-01, Update1 client2, 2007-06-01, Update2 client2, 2007-06-01, Update3

RE: sql statment to get connections

2007-06-25 Thread Adrian Lynch
See if sp_who and sp_who2 give you what you need. Adrian -Original Message- From: Keith McGee [mailto:[EMAIL PROTECTED] Sent: 25 June 2007 12:16 To: CF-Talk Subject: sql statment to get connections Do anyone know of a simple sql query to see what users are currently connected to a

Re: sql statment to get connections

2007-06-25 Thread Keith McGee
It worked. Thank You ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive:

Re: sql insert error

2007-06-05 Thread Jochem van Dieten
Daniel Kessler wrote: I'm doing a loop to insert values into a db (Oracle). I keep getting an error 'Invalid data for CFSQLTYPE CF_SQL_NUMERIC.' This is just one example, but I don't see the problem. One other thing though, in my cftry/error output, it says it's on field

RE: sql insert error

2007-06-05 Thread Robert Rawlins - Think Blue
'Invalid data for CFSQLTYPE CF_SQL_NUMERIC' That would suggest that the value you're passing in is not numeric, or the column name is an Integer, in which case you might need to use CF_SQL_INTEGER, I've not used ORACLE so can't be sure about that, first thing I would do is dump the variable

Re: sql insert error

2007-06-05 Thread daniel kessler
'Invalid data for CFSQLTYPE CF_SQL_NUMERIC' That would suggest that the value you're passing in is not numeric, or the column name is an Integer, in which case you might need to use CF_SQL_INTEGER, I've not used ORACLE so can't be sure about that, first None of the columns in the table structure

Re: SQL 2000, Case when field1 ='y' then field2='y' (set temp field value)

2007-05-23 Thread Gert Franz
You would need to write like follows: select case when PriceSec_National = 'Y' then 'Y' end as PriceSec_WesternCape Since you can not replace fields from the query, only retrieve a column named like a table field Greetings / Grüsse Gert Franz Customer Care Railo Technologies GmbH [EMAIL

Re: SQL 2000, Case when field1 ='y' then field2='y' (set temp field value)

2007-05-23 Thread Jochem van Dieten
ismail cassiem wrote: Is there anyway else to set the result field value temporary. eg Field1 Field2 TO Field1 Field2 YX YY select Field1, CASE WHEN Field1 = 'Y' THEN 'Y' ELSE Field2 END AS Field2 FROM Jochem

Re: SQL 2000, Case when field1 ='y' then field2='y' (set temp field value)

2007-05-23 Thread ismail cassiem
Thank You, it works! I really appreciate it. Regard, Ismail ~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 Flex 2 Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Re: SQL sum question

2007-05-18 Thread Gareth Hughes
I really should have been able to figure that out. Hopefully I'll remember next time :) Many thanks Jochem. - Original Message - From: Jochem van Dieten [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, May 18, 2007 12:36 PM Subject: Re: SQL sum question Gareth

Re: SQL sum question

2007-05-18 Thread Jochem van Dieten
Gareth Hughes wrote: select pname,sum(pagehit) as pagehit where dates between x and y group by pname, pagehit order by pagehit desc, pname select pname,sum(pagehit) as pageHitCumul where dates between x and y group by pname order by sum(pagehit) desc, pname Jochem

Re: SQL Tree Traversal

2007-05-18 Thread Rey Bango
Thanks James! James Holmes wrote: This is a good summary of SQL useful in this situation: http://www.oreilly.com/catalog/sqlpr/chapter/ch01.pdf On 5/18/07, Rey Bango [EMAIL PROTECTED] wrote: Guys, its been awhile since I've done tree/hierarchical SQL manipulation so I need some help. The

Re: SQL Tree Traversal

2007-05-17 Thread Greg Luce
I used this guy's model before without much trouble. http://www.intelligententerprise.com/001020/celko.jhtml;jsessionid=Y34B5ELGNJP1GQSNDLRCKH0CJUNN2JVN?_requestid=374630 Joe Celko is the man! Greg On 5/17/07, Rey Bango [EMAIL PROTECTED] wrote: Guys, its been awhile since I've done

Re: SQL Tree Traversal

2007-05-17 Thread James Holmes
This is a good summary of SQL useful in this situation: http://www.oreilly.com/catalog/sqlpr/chapter/ch01.pdf On 5/18/07, Rey Bango [EMAIL PROTECTED] wrote: Guys, its been awhile since I've done tree/hierarchical SQL manipulation so I need some help. The data looks something like this:

Re: sql date on the fly

2007-05-02 Thread daniel kessler
Alright, I figured out where the formatting is incorrect. I shouldn't have had the published_date= in there. Now it's giving me, ORA-01861: literal does not match format which is much closer. And I still have the question on whether I should use concatenation to create the string once I

Re: sql date on the fly

2007-05-02 Thread daniel kessler
Alright, ignore me - I seem to be making progress again. sigh often happens when I finally give up and post. Maybe giving up cleanses the mind somehow. ~| Create robust enterprise, web RIAs. Upgrade integrate Adobe Coldfusion

Re: sql - querying number fields as dates

2007-04-30 Thread James Holmes
If it helps, creating a date out of that is as easy as using the Oracle to_date() function. You could then use whatever comparison you like. On 4/30/07, Daniel Kessler wrote: I have Oracle db entries where three numbers represent a date. This is because the user can enter in just the year, or

Re: sql concatenate question

2007-04-26 Thread Jochem van Dieten
Daniel Kessler said: I have a problem concatenating in sql (using Oracle). I'm doing: SELECT a_fname || ',' || a_lname The error displayed is: [Table (rows 8 columns A_FNAME||','||A_LNAME): [A_FNAME||','|| A_LNAME: [EMAIL PROTECTED] ] is not indexable by A_FNAME||' Try aliasing the

Re: sql concatenate question

2007-04-26 Thread daniel kessler
Try aliasing the output. If that doesn't work, please provide the full statement. I'm don't know the term 'aliasing the output', but I have made debug='yes' on the query. The sql is: SELECT a_fname || ',' || a_lnameFROM publications_authors and can be found in the blue box on this

Re: sql concatenate question

2007-04-26 Thread daniel kessler
Try aliasing the output. If that doesn't work, please provide the full statement. Is aliasing putting the field in a variable? As in f_name as firstname? ~| Deploy Web Applications Quickly across the enterprise with ColdFusion

Re: sql concatenate question

2007-04-26 Thread James Holmes
Yes, this will be the issue: you need to do something like SELECT a_fname || ',' || a_lname as fullname On 4/26/07, Jochem van Dieten wrote: Daniel Kessler said: I have a problem concatenating in sql (using Oracle). I'm doing: SELECT a_fname || ',' || a_lname The error displayed is:

Re: sql concatenate question

2007-04-26 Thread daniel kessler
Try aliasing the output. If that doesn't work, please provide the full statement. Is aliasing putting the field in a variable? As in f_name as firstname? That worked - but why? ~| ColdFusion MX7 by Adobe® Dyncamically

Re: sql concatenate question

2007-04-26 Thread Jochem van Dieten
daniel kessler said: Try aliasing the output. If that doesn't work, please provide the full statement. Is aliasing putting the field in a variable? As in f_name as firstname? That worked - but why? The problem was not in Oracle, but in CF. Oracle returned a query with a column named

Re: sql concatenate question

2007-04-26 Thread daniel kessler
The problem was not in Oracle, but in CF. Oracle returned a query with a column named a_fname || ',' || a_lname and in CF that is not a valid variable name. Jochem ah, that makes total sense. And it IS a very odd column name. thank you for your help.

RE: SQL Query Help

2007-04-05 Thread jennygw
thanks to everyone who replied, problem solved. Jenny -Original Message- From: Rafael Marquez [mailto:[EMAIL PROTECTED] Sent: 04 April 2007 21:06 To: CF-Talk Subject: RE: SQL Query Help Well, it's not a brain fart. That query is kinda kinky. Use this as an example, replacing your

Re: SQL Help - Answered

2007-04-04 Thread [EMAIL PROTECTED]
Subject: Re: SQL Help - Answered I'm going to have to look at something. I'm still not getting what I anticipated. There are over 3700 records of which 1775 of them are distinct values for RATE. However, I am only getting values of 1 for COUNT(DISTINCT rate) as rateCount. I

RE: SQL Query Help

2007-04-04 Thread Ben Nadel
Maybe something like this (which I cannot test): SELECT c.id, c.name, i.* FROM customer c LEFT OUTER JOIN ( -- Get max (most recent) id (assuming pkey) of -- each invoice as grouped by client.

RE: SQL Query Help

2007-04-04 Thread Dawson, Michael
Assuming the invoice numbers increase each time, you can use MAX() and GROUP BY to get what you need. SELECT customer, MAX(invoiceNum) AS lastNum FROM table GROUP BY customer If invoices are not numbered sequentially, hopefully you have a date field that you can add to the grouping. M!ke

RE: SQL Query Help

2007-04-04 Thread Gaulin, Mark
Need more info: What would the query be to return the last invoice for a single customer? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 8:58 AM To: CF-Talk Subject: SQL Query Help having brain fart here ... ughh scenario:

RE: SQL Query Help

2007-04-04 Thread Rafael Marquez
(T.Deleted = 0) AND (T.Status 'Pending') AND (T.AccountType = 'Customer') GROUP BY T.CustomerID, T.TransactionDate, T.ID Hope this helps. -Original Message- From: Gaulin, Mark [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 3:39 PM To: CF-Talk Subject: RE: SQL Query Help

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

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? If I

RE: SQL question

2007-04-03 Thread Chad Gray
I tried that also and no records are returned. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:01 AM To: CF-Talk Subject: RE: SQL question How about you simply use WHERE dateCreated = '4/2/2007' Basically, lose the padding zeros. ~Che

RE: SQL question

2007-04-03 Thread Che Vilnonis
How about using... WHERE dateCreated LIKE '%4/2/2007%' -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:05 AM To: CF-Talk Subject: RE: SQL question I tried that also and no records are returned. -Original Message- From: Che

Re: SQL question

2007-04-03 Thread Paul Hastings
Chad Gray wrote: I want to find all records with the day 4/2/2007? WHERE DATEDIFF(day, dateCreated,'4/3/2007')=0 ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial

RE: SQL question

2007-04-03 Thread Chad Gray
I tried that too and no records are returned. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:09 AM To: CF-Talk Subject: RE: SQL question How about using... WHERE dateCreated LIKE '%4/2/2007%' -Original Message- From: Chad Gray

Re: SQL question

2007-04-03 Thread Phillip Ciske
and no records are returned. -Original Message- From: Che Vilnonis [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:01 AM To: CF-Talk Subject: RE: SQL question How about you simply use WHERE dateCreated = '4/2/2007' Basically, lose the padding zeros. ~Che -Original

RE: SQL question

2007-04-03 Thread Mark A Kruger
Ooh.. I like that one -Original Message- From: Paul Hastings [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 9:10 AM To: CF-Talk Subject: Re: SQL question Chad Gray wrote: I want to find all records with the day 4/2/2007? WHERE DATEDIFF(day, dateCreated,'4/3/2007')=0

RE: SQL question

2007-04-03 Thread Jim Gurfein
[mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:10 AM To: CF-Talk Subject: Re: SQL question Chad Gray wrote: I want to find all records with the day 4/2/2007? WHERE DATEDIFF(day, dateCreated,'4/3/2007')=0

RE: SQL question

2007-04-03 Thread Chad Gray
AH! This works! Thanks! -Original Message- From: Paul Hastings [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:10 AM To: CF-Talk Subject: Re: SQL question Chad Gray wrote: I want to find all records with the day 4/2/2007? WHERE DATEDIFF(day, dateCreated,'4/3/2007')=0

RE: SQL question

2007-04-03 Thread Dawson, Michael
# AND MONTH(dateCol)=#monthVar# AND YEAR(dateCol)=#yearVal# -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 9:12 AM To: CF-Talk Subject: RE: SQL question I tried that too and no records are returned. -Original Message- From: Che Vilnonis

RE: SQL question

2007-04-03 Thread Steve Brownlee
The trick with date and MSSQL is using and . The string '04/02/2007' is seen by MSSQL as '04/02/2007 00:00:00', so your condition will return only those records with that exact timestamp. You have to use: WHERE dateCreated = '04/02/2007' AND dateCreateted '04/03/2007' Steve Brownlee

RE: SQL question

2007-04-03 Thread Ben Nadel
People people people :) I have seen casting, converting, date-diffing, LIKE'ing, MONTH()/Day()/Year()'ing Please do not run functions on your date/time fields. Running a function on a column in general is extremely slow. Date/time stamps can be used quite nicely with out them: DECLARE @date

RE: SQL question

2007-04-03 Thread Mark A Kruger
Ben, Ok... Nicely done. What about BETWEEN ... Any benefits there? WHERE date_created BETWEEN @date AND @date + 1 -Mark -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 9:26 AM To: CF-Talk Subject: RE: SQL question People people people

RE: SQL question

2007-04-03 Thread Ben Nadel
). .. Ben Nadel Certified Advanced ColdFusion MX7 Developer www.bennadel.com Need ColdFusion Help? www.bennadel.com/ask-ben/ -Original Message- From: Mark A Kruger [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:30 AM To: CF-Talk Subject: RE: SQL question Ben, Ok... Nicely done

RE: SQL question

2007-04-03 Thread Mark A Kruger
Ah Gotcha. -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 9:35 AM To: CF-Talk Subject: RE: SQL question BETWEEN is good, but it is doubly-inclusive meaning that it is like doing both = and =. In this case, it might turn up records where

RE: SQL question

2007-04-03 Thread Chad Gray
On the (@date + 1) how do you know it is adding one day? Out of curiosity how do you add one year? Thanks for the clean elegant solution. I will try it out. -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:26 AM To: CF-Talk Subject: RE

RE: SQL question

2007-04-03 Thread Chad Gray
I just tried this and I get no records. dateCreated = 04/02/2007 AND dateCreated (04/02/2007 + 1) Is this method compatible with MS SQL? -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:41 AM To: CF-Talk Subject: RE: SQL question

Re: SQL question

2007-04-03 Thread Joe Rinehart
year? Thanks for the clean elegant solution. I will try it out. -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:26 AM To: CF-Talk Subject: RE: SQL question People people people :) I have seen casting, converting, date-diffing

RE: SQL question

2007-04-03 Thread Ben Nadel
Subject: RE: SQL question On the (@date + 1) how do you know it is adding one day? Out of curiosity how do you add one year? Thanks for the clean elegant solution. I will try it out. ~| Deploy Web Applications Quickly across

Re: SQL question

2007-04-03 Thread Joe Rinehart
? -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:41 AM To: CF-Talk Subject: RE: SQL question On the (@date + 1) how do you know it is adding one day? Out of curiosity how do you add one year? Thanks for the clean elegant solution. I

RE: SQL question

2007-04-03 Thread Ben Nadel
/ -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:46 AM To: CF-Talk Subject: RE: SQL question I just tried this and I get no records. dateCreated = 04/02/2007 AND dateCreated (04/02/2007 + 1) Is this method compatible with MS SQL

RE: SQL question

2007-04-03 Thread Chad Gray
int. So I probably have to cast as a date in order to get this to work. -Original Message- From: Joe Rinehart [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 03, 2007 10:48 AM To: CF-Talk Subject: Re: SQL question Chad, Try WHERE dateCreated = @someDate AND dateCreated

RE: SQL question

2007-04-03 Thread Ben Nadel
:00 AM To: CF-Talk Subject: RE: SQL question Thanks Ben, and Joe here is what finally worked for me. dateCreated = '04/03/2007' AND dateCreated DATEADD(DAY, 1, '04/03/2007') With dateCreated = '04/03/2007' AND dateCreated ('04/03/2007' + 1) I get this error: Conversion failed when converting

Re: SQL Help

2007-04-03 Thread Greg Morphis
You need a group by in your query.. SELECT count(DISTINCT rate) as rateCount, rate FROMmyrates WHERE my_code = 385 and year = 2005 GROUP BY rate ORDER BY rate On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Why do the first two queries work and the last one fail? The only

Re: SQL Help - Answered

2007-04-03 Thread [EMAIL PROTECTED]
Thank you Greg Morphis wrote: You need a group by in your query.. SELECT count(DISTINCT rate) as rateCount, rate FROMmyrates WHERE my_code = 385 and year = 2005 GROUP BY rate ORDER BY rate On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Why do the

Re: SQL Help - Answered

2007-04-03 Thread Greg Morphis
No problem, if you want to know why take a look at aggregate functions, which is what count is, as well as others.. On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thank you Greg Morphis wrote: You need a group by in your query.. SELECT count(DISTINCT rate) as rateCount, rate

Re: SQL Help - Answered

2007-04-03 Thread [EMAIL PROTECTED]
I'm going to have to look at something. I'm still not getting what I anticipated. There are over 3700 records of which 1775 of them are distinct values for RATE. However, I am only getting values of 1 for COUNT(DISTINCT rate) as rateCount. I was trying to find out how many records are

Re: SQL Help - Answered

2007-04-03 Thread Greg Morphis
can you provide a sample of your data and the way your table is designed (column name, type)? Thanks On 4/3/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm going to have to look at something. I'm still not getting what I anticipated. There are over 3700 records of which 1775 of them are

Re: SQL Help - Answered

2007-04-03 Thread Josh Nathanson
that and see if you're any closer to what you want. -- Josh - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Tuesday, April 03, 2007 2:09 PM Subject: Re: SQL Help - Answered I'm going to have to look at something. I'm still

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

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

Re: SQL DatePart function not working in cfquery...

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 work in

Re: SQL DatePart function not working in cfquery...

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 cfquery...

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 * FROM items WHERE

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

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

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
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 record in this case

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,

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 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 Ben Forta
, 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 should

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 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.

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