Welcome to SPN

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

Sign Up Now!

Time Comparison

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

  1. Lamya

    Lamya
    Expand Collapse
    Guest

    Its a Car Booking System.

    Table 1 include (Employee Name, Car No., Date out, Time out, Date in, Time in)
    Table 2 include (Car No, Fine Date, Fine Time)
    Query: To find out whose driving the car during the fine date and time??

    Our query works fine with date (Date in>Fine date>Date Out), however time
    comparison doesn't work as the date comparison.
    Please we need a HELP!!
     
  2. Loading...


  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    In a fresh column of the Field row in query design, enter:
    FineDateTime: CVDate([Table 2].[Fine Date] + [Table 2].[FineTime])

    In the Criteria row below this, enter:
    Between CVDate([Table 1].[Date out] + [Table 1].[Time out])
    And CVDate([Table 1].[Date in] + [Table 1].[Time in])

    It would be more efficient to combine those date and time pairs into one
    field each. So Table1 would have fields:
    OutDateTime contains the date and time booked out.
    InDateTime contains the date and time booked back in.
    and so on.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Lamya" <Lamya@discussions.microsoft.com> wrote in message
    news:EDA8067D-FCE5-48F9-9D92-E05F9072F037@microsoft.com...
    > Its a Car Booking System.
    >
    > Table 1 include (Employee Name, Car No., Date out, Time out, Date in, Time
    > in)
    > Table 2 include (Car No, Fine Date, Fine Time)
    > Query: To find out whose driving the car during the fine date and time??
    >
    > Our query works fine with date (Date in>Fine date>Date Out), however time
    > comparison doesn't work as the date comparison.
    > Please we need a HELP!!
     

Share This Page