Apr 17, 2001 #1 GriLLo Programmer Joined Apr 17, 2001 Messages 2 Location 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, 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?
Apr 17, 2001 #2 xor Programmer Joined Jan 7, 2001 Messages 71 Location NZ 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="get_records" datasource="comweb" dbtype="ODBC"> SELECT * FROM MyTable WHERE Month(Date) = #userDefinedMonth# </cfquery> Upvote 0 Downvote
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="get_records" datasource="comweb" dbtype="ODBC"> SELECT * FROM MyTable WHERE Month(Date) = #userDefinedMonth# </cfquery>