Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2013

    Unhappy Unanswered: Count in Access SQL 2003

    I am trying to count the number of days with two different activities (1,2). Even though there are more than one activity at different positions in a day it should count it as one day. For example,

    01 Apr 2008 2 0719.670S 15103.090E
    01 Apr 2008 1 0721.580S 15056.610E
    01 Apr 2008 1 0726.800S 15058.780E
    02 Apr 2008 2 0745.030S 15100.200E
    02 Apr 2008 1 0745.700S 15104.560E
    06 Apr 2008 2 0633.590S 15048.010E
    07 Apr 2008 2 0622.300S 15055.910E
    08 Apr 2008 2 0512.970S 15317.750E
    09 Apr 2008 2 0439.940S 15554.010E
    10 Apr 2008 2 0229.710S 15431.100E
    12 Apr 2008 2 0312.860S 14713.160E

    The answer I need should be 8 days.

  2. #2
    Join Date
    Apr 2004
    outside the rim
    Is that a string of text?

    If the date is always the first 11 characters, use the Left function to strip out the date as a literal, convert it to a date using a conversion function and use the DateDif function.

    You will want to use the DateDif on the Min and Max values - a "totals" query would be an option if you are using queries only.

    Not terribly efficient, but gets the job done.
    have fun!

    Todd S.
    click to email

    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET

    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

Posting Permissions

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