Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering Date/Time attributes

Status
Not open for further replies.

GriLLo

Programmer
Apr 17, 2001
2
BR
Hi,

How can I filter a date/time access field only by month? or by year ?

The user will specify a month and it will show only the records for that month? Do I need to configure the way the date is inserted in the db?
 
Hi GriLLo

I'm not positive about Access (if that's the DB you are using), but for SQL Server the following works...

<cfquery name=&quot;get_records&quot; datasource=&quot;comweb&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM MyTable
WHERE Month(Date) = #userDefinedMonth#
</cfquery>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top