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

2012-11-15 Thread Eric Bourland
with a 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', -1, getdate

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 e...@ebwebwork.com 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

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

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 gmorp...@gmail.com wrote: What DB are you using? On Wed, Nov 14, 2012 at 7:43 AM, Eric Bourland e...@ebwebwork.com

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 gmorp...@gmail.com wrote: cast(dateadd('y', -1,

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

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 cfsearch...@yahoo.com wrote: cast(dateadd('y', -1, getdate()) as date) as -- getdate() in MSSQL I do not think 2005

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:

Re: Query How-To

2003-01-23 Thread Ewok
try selecting e.firstname alone as well as everything else you have already then add your order by e.firstname SELECT DISTINCT(t.employeeid), e.firstname e.firstname + e.lastname AS name FROM transactions t LEFT JOIN employees e ON t.employeeid = e.employeeid ORDER BY e.firstname

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

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 Subject: Query How-To How

RE: Query How-To

2003-01-22 Thread Bryan Love
ORDER BY name +---+ Bryan Love Macromedia Certified Professional Internet Application Developer Database Analyst TeleCommunication Systems [EMAIL PROTECTED] +---+ ...'If there must be trouble, let it be

Re: Query How-To

2003-01-22 Thread Jim McAtee
: 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.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk