Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $95

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.
    > >
    > >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page