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.

 All Forums
 Other Forums
 MS Access
 selecting months

Author  Topic 

neil_akoga
Yak Posting Veteran

56 Posts

Posted - 2009-06-04 : 06:42:44
ok i'm banging my head against a brick wall here, how do i select dates that are a certain month

my date/times are stored as follows under a column called entry date
28/09/2009

how do i select rows where the date is june for example - which i presume is 6

i figure it's something like this

select * from myTable where month(entryDate) = month(6) but this doesn't work. all help is greatly appreciated

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-04 : 06:43:28
select * from myTable where month(entryDate) = 6


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-04 : 06:43:54
select * from myTable where entryDate >= #2009-06-01# AND entryDate < #2009-07-01#



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

neil_akoga
Yak Posting Veteran

56 Posts

Posted - 2009-06-04 : 06:47:32
thanks peso, it was the query window in visual studio 2008 that was throwing me off the scent, just went all old school and opened access and all works
Go to Top of Page
   

- Advertisement -