Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Access Query

Discussion in 'Information Technology' started by dan, Jul 28, 2006.

Tags:
  1. dan

    dan
    Expand Collapse
    Guest

    I have a database that has a date filed mm/dd/yyyy. I'm trying to set
    the criteria in the query to olny show me the prior days information.
    In other words I want to always see what infomation was entered
    yesterday. If today is friday I want to only see thursdays info. I've
    tried different things but have not made it work yet. I know its going
    to be something with Now()-1 but cant seem to get the syntax right. ANy
    help would be appreciated.
     
  2. Loading...


  3. Michael H

    Michael H
    Expand Collapse
    Guest

    dan,

    Try: Date()-1 .

    -Michael



    "dan" wrote:

    > I have a database that has a date filed mm/dd/yyyy. I'm trying to set
    > the criteria in the query to olny show me the prior days information.
    > In other words I want to always see what infomation was entered
    > yesterday. If today is friday I want to only see thursdays info. I've
    > tried different things but have not made it work yet. I know its going
    > to be something with Now()-1 but cant seem to get the syntax right. ANy
    > help would be appreciated.
    >
    >
     
  4. Joseph Meehan

    Joseph Meehan
    Expand Collapse
    Guest

    From the help file:

    < Date( ) - 30 For an OrderDate field, orders more than 30 days old


    You should be able to take it from there.

    --
    Joseph Meehan

    Dia duit
    "dan" <daniel.koen@crown.com> wrote in message
    news:1147367696.469294.174720@u72g2000cwu.googlegroups.com...
    >I have a database that has a date filed mm/dd/yyyy. I'm trying to set
    > the criteria in the query to olny show me the prior days information.
    > In other words I want to always see what infomation was entered
    > yesterday. If today is friday I want to only see thursdays info. I've
    > tried different things but have not made it work yet. I know its going
    > to be something with Now()-1 but cant seem to get the syntax right. ANy
    > help would be appreciated.
    >
     
  5. KARL DEWEY

    KARL DEWEY
    Expand Collapse
    Guest

    You might want someting different if you do not work on Saturday and Sunday.
    Below check day of the week and if it is Monday pulls Friday's records.

    IIf(Weekday(Date())=2,Date()-3,Date()-1)

    "Michael H" wrote:

    > dan,
    >
    > Try: Date()-1 .
    >
    > -Michael
    >
    >
    >
    > "dan" wrote:
    >
    > > I have a database that has a date filed mm/dd/yyyy. I'm trying to set
    > > the criteria in the query to olny show me the prior days information.
    > > In other words I want to always see what infomation was entered
    > > yesterday. If today is friday I want to only see thursdays info. I've
    > > tried different things but have not made it work yet. I know its going
    > > to be something with Now()-1 but cant seem to get the syntax right. ANy
    > > help would be appreciated.
    > >
    > >
     

Share This Page