That's a nice one Charlie. Much simpler than mine.

<!----------------//------
andy matthews
web developer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->

-----Original Message-----
From: Charlie Griefer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 21, 2005 1:22 PM
To: CF-Talk
Subject: Re: All Items From LAST month


there's probably a pure SQL way to do it too, but since I'm better
with CF than SQL, my hybrid solution would be:

<cfset lastMonth = month(dateAdd('m', -1, now())) />

<cfquery name="myQuery" datasource="myDSN">
     SELECT
          columns
     FROM
          tablename
     WHERE
          month(myDateColumn) = #lastMonth#
</cfquery>

standard disclaimer about being untested, could cause warts, etc.


On 9/21/05, Claremont, Timothy <[EMAIL PROTECTED]> wrote:
> My records get time stamped when they are entered. It is a simple
> date/time field.
>
> What is the correct syntax for retrieving ALL records entered LAST
> MONTH.
>
> So, if today (Now()) is ANY day in September, show me all the records
> entered in August.
>
> TIA,
> Tim
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please delete it
from your system.
>
> This footnote also confirms that this email message has been swept for
> the presence of computer viruses.
>
> Thank You,
> Viahealth
> **********************************************************************
>
>
>



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218832
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to