If you are using SQL 7 this will work and #cnt# is 1 to 12.
WHERE (DATEPART(m, rundate) = #cnt#)



----- Original Message -----
From: "Tim" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, January 27, 2002 12:08 PM
Subject: Query for specified month


> I need to query a database for records based on month.
>  I have a date field, and I tried the following two
> ways:
>
> WHERE DatePart("m", rundate) = #cnt
> and I tried
> WHERE Month(rundate) = #cnt#
>
> #cnt is a variable that gets incremented.  I keep
> getting errors that say DatePart and Month are Invalid
> Operators.
>
> Any ideas on how to do this?
>
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions!
> 
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to