1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

print report

Discussion in 'MS Access' started by Gostap, Jan 5, 2007.

  1. Gostap

    Gostap New Member

    Joined:
    Jan 5, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    Hi;

    Probably a stupid question from a newbie;
    I have a form with several test results taken during a 24-hour priod.
    Each test has a field with time format like this: yyyy-mm-dd hh:mm. (not primary key)
    I want to print a report based on the data in to modes.
    First one, specified by one particular time e.g. 2006-12-19 22:37.
    That’s no problem. next one, I want to print out every report during one 24-hour period.
    e.g. 2006-12-20 06:30
    2006-12-20 15:32
    2006-12-20 71:15

    i.e. all report chosen by a specific date without any consideration to the time. I understand I have to format date somehow in VB but how? it will not work for me.

    hope somebody have mercy 

    Best Regards

    Gostap
     
  2. ever_thus

    ever_thus New Member

    Joined:
    Jan 3, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    0
    It's actually not such a stupid question. You'd think a clause like:

    Code:
    WHERE table.date = #1/1/2007#
    would return all entries for that date, but it only returns entries where the time is undefined.

    What you're going to have to do is
    Code:
    WHERE table.date > #1/1/2007# AND table.date < #1/2/2007
    If you have dates without the time defined iut won't return them. In that case you need to write
    Code:
    WHERE (table.date > #1/1/2007# AND table.date < #1/2/2007) OR table.date = #1/1/2007
     
  3. Gostap

    Gostap New Member

    Joined:
    Jan 5, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    I'm grateful, thank you very much, I will try it.

    BG

    Gostap
     

Share This Page