Microsoft Access Database Querys?

Can anyone help ive looked on the net and everything but cant seam to find the expression for imformation regarding Months.For example i have a quesiton asking who will be staying during the month of March?In my table the date show as 2/3/2001.

geek_quinny15, Jan 29, 12:53 pm


You'd want an expression somewhat like SELECT * FROM <table> WHERE DATEPART('m', <datecolumn>) = 3

geek_vtecintegra, Jan 29, 12:59 pm

i must be stupid, its not working.

geek_quinny15, Jan 29, 1:27 pm

table will hav to be the actual table name.
datecolumn will have to be the actual column name.

geek_r.g.nixon, Jan 29, 1:37 pm

DATEPART('m', <ArrivalDate>) = 3 , this is what im putting in and its telling me "the expression you have entered has to many closing parentheses".

geek_quinny15, Jan 29, 1:48 pm

You don't need the <>'s that was just to denote you needed to change that to you actual column name :)

geek_vtecintegra, Jan 29, 1:52 pm

datepart['m' ArrivalDate]"=3 , OMG im getting so frustrated, still not working.

geek_quinny15, Jan 29, 2:02 pm

put in the comma - after 'm'

geek_r.g.nixon, Jan 29, 2:16 pm

and what is with the " before the equals?

geek_r.g.nixon, Jan 29, 2:17 pm

I don't use Access because it's a piece of crap, so I don't know the syntax.
but I would expect it to be

DatePart ("m", ArrivalDate) = 3

geek_traderstuff, Jan 29, 2:19 pm

")=3 , it says type mismatch criteria.I dont put in the " they just appear automatic.I have to use access because its for a ucol course.

geek_quinny15, Jan 29, 2:37 pm

ok thanks for everyones help might just get back to that one and do as much as i can.

geek_quinny15, Jan 29, 2:45 pm

Type mismatch implies (to me, but I don't use Access) that the date column is in character format rather than date format.

geek_r.g.nixon, Jan 29, 3:33 pm

In that case try the CDate() function.Just watch out for date formats (i.e. d/m/y vs m/d/y)

geek_vtecintegra, Jan 29, 3:43 pm