use the BETWEEN operator in your SQL statement and use the first and last of
the month.
-----Original Message-----
From: John Barleycorn [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 06, 2001 11:58 PM
To: CF-Talk
Subject: How to get records from this month and only this month
Hello, i need to pull records out of my database for one month and only that
month (default current month, but can be any month). I've tried using:
SELECT quantity_nb
FROM tblDailyNumbers nb
WHERE DateDIFF(mm, #CreateODBCDate(Now())#, getDate()) = 0
AND DateDIFF(yy, #CreateODBCDate(Now())#, getDate()) = 0
but i'm still getting records from both months in my test data. Can anyone
tell me what i'm doing wrong?
Thanks in advance.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists