RE: query: how to return records that are increments of one year old?

2012-11-15 Thread Eric Bourland
question about CFSCHEDULE. Hope your day is going well. Eric -Original Message- From: Leigh [mailto:cfsearch...@yahoo.com] Sent: Wednesday, November 14, 2012 11:03 AM To: cf-talk Subject: Re: query: how to return records that are increments of one year old? > cast(dateadd('y'

Re: query: how to return records that are increments of one year old?

2012-11-14 Thread Leigh
Yep, there is always more than one way to skin a cat.  (Ouch... poor cats) -Leigh ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://w

Re: query: how to return records that are increments of one year old?

2012-11-14 Thread Greg Morphis
a purely MSSQL way would be SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, DATEADD(yy, -1, GETDATE( since 2005 doesn't support that. On Wed, Nov 14, 2012 at 11:02 AM, Leigh wrote: > > > cast(dateadd('y', -1, getdate()) as date) as -- getdate() in MSSQL > > I do not think 2005 supports the "date"

Re: query: how to return records that are increments of one year old?

2012-11-14 Thread Leigh
> cast(dateadd('y', -1, getdate()) as date) as  -- getdate() in MSSQL I do not think 2005 supports the "date" type. A CF alternative is using dateAdd("", -1, now()) to get the date and time one year ago. Then use cfqueryparam with type "cf_sql_date" which automatically drops any time portio

RE: query: how to return records that are increments of one year old?

2012-11-14 Thread Eric Bourland
Greg, thank you very much. I will try this out and report my progress later this evening. Eric -Original Message- From: Greg Morphis [mailto:gmorp...@gmail.com] Sent: Wednesday, November 14, 2012 7:52 AM To: cf-talk Subject: Re: query: how to return records that are increments of one

Re: query: how to return records that are increments of one year old?

2012-11-14 Thread Greg Morphis
try that first one, I assume your date column in the DB is storing just the date and not the datetime? if it's storing datetime there would be a problem and you'd have to cast that as a date too. On Wed, Nov 14, 2012 at 7:52 AM, Greg Morphis wrote: > cast(dateadd('y', -1, getdate()) as date) a

Re: query: how to return records that are increments of one year old?

2012-11-14 Thread Greg Morphis
cast(dateadd('y', -1, getdate()) as date) as -- getdate() in MSSQL or trunc(dateadd('y', -1, sysdate)) -- sysdate in Oracle On Wed, Nov 14, 2012 at 7:46 AM, Greg Morphis wrote: > What DB are you using? > > > On Wed, Nov 14, 2012 at 7:43 AM, Eric Bourland wrote: > >> >> Greetings. I need s

RE: query: how to return records that are increments of one year old?

2012-11-14 Thread Eric Bourland
MS SQL Server 2005 ColdFusion 9.0.1 -Original Message- From: Greg Morphis [mailto:gmorp...@gmail.com] Sent: Wednesday, November 14, 2012 7:46 AM To: cf-talk Subject: Re: query: how to return records that are increments of one year old? What DB are you using? On Wed, Nov 14, 2012 at

Re: query: how to return records that are increments of one year old?

2012-11-14 Thread Greg Morphis
What DB are you using? On Wed, Nov 14, 2012 at 7:43 AM, Eric Bourland wrote: > > Greetings. I need some advice again. I need to use CFSCHEDULE to schedule a > task that does the following: > > > > * review all records in table 'membersTable', once per day > > * return records that are one year

query: how to return records that are increments of one year old?

2012-11-14 Thread Eric Bourland
Greetings. I need some advice again. I need to use CFSCHEDULE to schedule a task that does the following: * review all records in table 'membersTable', once per day * return records that are one year (365 days) old, then two years old, then three, and so on in increments of years * send a re

Re: Query How-To

2003-01-23 Thread Ewok
- Original Message - From: "Jim McAtee" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, January 22, 2003 7:56 PM Subject: Query How-To > How can I go about ordering the following query by first name? > > > SELECT

Re: Query How-To

2003-01-22 Thread Jim McAtee
: Wednesday, January 22, 2003 6:34 PM Subject: RE: Query How-To > ORDER BY name ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.

RE: Query How-To

2003-01-22 Thread Bryan Love
le, let it be in my day, that my child may have peace'..." - Thomas Paine, The American Crisis "Let's Roll" - Todd Beamer, Flight 93 -Original Message- From: Jim McAtee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 4:56 PM To: CF-Tal

RE: Query How-To

2003-01-22 Thread Matthew Walker
Just put e.firstname in as one of the SELECTed fields, i.e. SELECT DISTINCT t.employeeid, e.firstname + e.lastname AS name, e.firstname > -Original Message- > From: Jim McAtee [mailto:[EMAIL PROTECTED]] > Sent: Thursday, 23 January 2003 1:56 p.m. > To: CF-Talk > Subjec

Re: Query How-To

2003-01-22 Thread paul smith
Remove the parens around t.employeeid ? DISTINCT applies to ALL columns requested, not just one. So DISTINCT can work correctly and return duplicate t.employeeid's (if there are dups in the data). To get DISTINCT t.employeeid's, you'll have to run this query first: SELECT DISTINCT t.employeeid

Query How-To

2003-01-22 Thread Jim McAtee
How can I go about ordering the following query by first name? SELECT DISTINCT(t.employeeid), e.firstname + e.lastname AS name FROM transactions t LEFT JOIN employees e ON t.employeeid = e.employeeid The following query throws an error about a conflict between the ORDER BY and DISTI

RE: Caching a Query: How To?

2001-01-13 Thread Philip Arnold - ASP
> I was under the impression that cachedafter was just what it says. Cache > the query *after* a date for all eternity. Why would you "cache until" a > date when cachedwithin already does that? ;) Sort of - It's useful if you know that you've got a cached query that will never change, such as a

Re: Caching a Query: How To?

2001-01-12 Thread CF
> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Friday, January 12, 2001 5:21 PM Subject: RE: Caching a Query: How To? > Shouldn't CachedAfter really be called CachedBefore? > > You are telling it to cache the query UNTIL a specified date/time, right? > > At 05:27

RE: Caching a Query: How To?

2001-01-12 Thread Dave Watts
> Shouldn't CachedAfter really be called CachedBefore? "CACHEDUNTIL" would be more accurate than either. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fu

Re: Caching a Query: How To?

2001-01-12 Thread t nelson
F-Talk <[EMAIL PROTECTED]> Subject: Caching a Query: How To? Date: Fri, 12 Jan 2001 11:00:07 -0500 Received: from [207.31.122.140] by hotmail.com (3.2) with ESMTP id MHotMailBC287BC70067D820F3B7CF1F7A8C43110; Fri Jan 12 08:29:01 2001 Received: from houseoffusion.com ([207.31.122.140])

RE: Caching a Query: How To?

2001-01-12 Thread Dick Applebaum
The CachedAfter parameter actually caches the query any time *After* the date/time given. The query remains in the cache *until* the query is reissued with a later date /time. (Assuming the query is not purged because of it being LRU and cache space is needed) This is very useful to cause cac

RE: Caching a Query: How To?

2001-01-12 Thread Peter Theobald
Shouldn't CachedAfter really be called CachedBefore? You are telling it to cache the query UNTIL a specified date/time, right? At 05:27 PM 1/12/01 +, Philip Arnold - ASP wrote: >> I have three different queries on page that the only difference among >> them is what the results are ordered by

RE: Caching a Query: How To?

2001-01-12 Thread Robert Segal
Use the cachedwithin (relative time) or cachedafter (absolute time) attributes of the cfquery tag. -Original Message- From: James Taavon [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 11:00 AM To: CF-Talk Subject: Caching a Query: How To? I have three different queries on

RE: Caching a Query: How To?

2001-01-12 Thread Philip Arnold - ASP
> I have three different queries on page that the only difference among > them is what the results are ordered by. I suppose that I can cache the > query the so when the user selects how they want the list sorted, the > process time will be decreased. My question is I need help because I > have ne

RE: Caching a Query: How To?

2001-01-12 Thread Christopher Olive, CIO
] http://www.crescotech.com -Original Message- From: James Taavon [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 11:00 AM To: CF-Talk Subject: Caching a Query: How To? I have three different queries on page that the only difference among them is what the results are ordered

Caching a Query: How To?

2001-01-12 Thread James Taavon
I have three different queries on page that the only difference among them is what the results are ordered by. I suppose that I can cache the query the so when the user selects how they want the list sorted, the process time will be decreased. My question is I need help because I have never done i