Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    between [] and [] (Access 2000)

    I have a db the have customers sales in it. I run a number of queries that are in a macro. The problem is that i have to enter the between date every time. How can I get the date to be auto-entered. The date I would need it to be is between [ the first day of last month ] and [he last day of last month]

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: between [] and [] (Access 2000)

    Tom: Try these on for size:

    1st day of Previous month: =dateserial(year(date()),month(date()),-1,1)

    Last day of Previous month: =dateserial(year(date()),month(date()),0)

    HTH.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: between [] and [] (Access 2000)

    See this post for a quick and easy way to calculate the last day of the prior month. The first day of the prior month could be calculated by using DateAdd to subtract a month form the lastday of the prior month and then add a day. Be careful, though, I seemed to have found a minor bug in the date math that seems to think there were 29 days in Feb 2002. <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>

    Here's a formula that will give you the first day of the prior month:

    dtmFirst = DateAdd("d", 1, DateAdd("m", -1, Date) - Day(Date))
    Charlotte

  4. #4
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: between [] and [] (Access 2000)

    It brings up the data fine but my problem now is I get an error you will reset your code in break mode

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •