> SELECT  quantity_nb
> FROM tblDailyNumbers nb
> WHERE DateDIFF(mm, #CreateODBCDate(Now())#, getDate()) = 0
> AND DateDIFF(yy, #CreateODBCDate(Now())#, getDate()) = 0


The syntax of this may be wrong but I'm pretty sure you want something more
like this

SELECT  quantity_nb
FROM tblDailyNumbers nb
WHERE DatePart("mm", yourDateField) = #Month(Now())#
   AND DatePart("yy", yourDateField) = #Year(Now())#

(BTW, the DatePart function is from my ropey memory - think it works in SQL
Server 7)

or alternatively

SELECT  quantity_nb
FROM tblDailyNumbers nb
WHERE yourDateField BETWEEN #CreateODBCDate(CreateDate(Year(Now()),
Month(Now()), 1))# AND CreateODBCDate(CreateDate(Year(Now()), Month(Now()),
DaysInMonth(Now())))


-- 
Aidan Whitehall <[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental +44 (0)1695 51775
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to