ms access - BETWEEN two dates with functions SQL -


i extract data 20th last month until now, impossible make functions when making between , command?

where ([dtupdated] between ((year(date()))-(month(date())-1)-20)     , (date())) 

you can use dateadd subtract 1 month today's date. here's example immediate window.

? date() 8/15/2013  ? dateadd("m", -1, date()) 7/15/2013  

then can determine year , month of previous date.

? year(dateadd("m", -1, date()))  2013  ? month(dateadd("m", -1, date()))  7  

so can give dateserial year, month, , 20 day.

? dateserial(year(dateadd("m", -1, date())), _     month(dateadd("m", -1, date())), 20) 7/20/2013  

in query, try ...

where [dtupdated] between     dateserial(         year(dateadd("m", -1, date())),         month(dateadd("m", -1, date())),         20)     , date() 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -