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
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
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
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
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,
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
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.
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
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:
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
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
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
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
: 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
14 matches
Mail list logo