Hi Brian,

Using SQL Server you could do it like this

where   datePart(YEAR, myDate) = #arguments.year#
        and datePart(MONTH, myDate) = #arguments.month#

I'm not sure if it's more efficent, but I find it pretty easy to read.

Pete

>>> [EMAIL PROTECTED] 08/20/03 07:37am >>>
What the best way to selected a months work of dates from a table. For
example I want to select all orders for April 2003.

Presently I create a 2 variables call start and end date.  These might be
01/05/2003 and 01/06/2003 and then use these in the SQL where clause ie
where order_date >= #variables.state_date# and order_date <
#variables.end_date#.  I have left out the createodb bits.

Brian Knott

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED] 
To unsubscribe send a blank email to [EMAIL PROTECTED] 

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to