You need to specify the database column in the where clause.
So for example, if the database column is called Month, then you need to say
WHERE Month = #Datepart(m, completedate)#
Or
WHERE Month = #Month(completedate)#
HTH
N
on 23/03/01 8:12, Francis, Jennifer at [EMAIL PROTECTED] wrote:
> I have a date field (completedate) stored in my database. I want to be able
> to pull out all of the records by a selected month for a month-end report.
>
> Is there an easy way of doing this? I've tried
>
> where datepart('m', completedate)='#month#'
>
> but I keep getting an "invalid column name" error.
>
> Any help would be MUCH appreciated...
>
> Jennifer Francis
> AT&T Wireless
> Training Development & Design
> [EMAIL PROTECTED]
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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