Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Hi im new to SQL and struggling with a query, was wondering if anyone could help;Im trying to run a query to get results of a certain month within a table I think this is what it would look like but it doesn't seem to workthanksselect *from customerOrderwhere date (mm.(10))
webfred
Master Smack Fu Yak Hacker
8781 Posts
Posted - 2008-12-01 : 15:03:07
An example:
select * from customerOrderwhere MONTH(YourDateColumn) = 10 -- 10=october
But this is regardless the year.You can use YEAR() similar to limit the result.WebfredNo, you're never too old to Yak'n'Roll if you're too young to die.