Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2002
    Posts
    22

    Unanswered: Help with Datediff?

    I only want to count specific fields that have a specific date in them, for example:

    I have one field Last date
    and one field New date

    I only want to count the entries that are 2002 dates not 2001, I was wondering if there is a way to do that thanks for your help.

    Mojo

  2. #2
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    33

    Re: Help with Datediff?

    Extract the year using DatePart function, filter out what year you need, and calculate DateDiff using that data.
    HTH
    Originally posted by mojo-jo
    I only want to count specific fields that have a specific date in them, for example:

    I have one field Last date
    and one field New date

    I only want to count the entries that are 2002 dates not 2001, I was wondering if there is a way to do that thanks for your help.

    Mojo

  3. #3
    Join Date
    Aug 2002
    Location
    Québec, Canada
    Posts
    109
    You can use YEAR function

    Code:
    Where Year([New Date]) = 2002
    This do not use any DateDiff, what DateDiff for in your case? Date Diff calculate the difference between two dates using a specific Interval.

    JefB

  4. #4
    Join Date
    Jan 2002
    Location
    UK
    Posts
    67

    Re: Help with Datediff?

    Originally posted by mojo-jo
    I only want to count specific fields that have a specific date in them, for example:

    I have one field Last date
    and one field New date

    I only want to count the entries that are 2002 dates not 2001, I was wondering if there is a way to do that thanks for your help.

    Mojo
    I was wondering if you want to count the fields or the no of recs in the tables.

    In case you are looking for recs.

    Then you can use something like this:

    SELECT Count(Last date) AS Count_Last_date
    FROM TBL_NAME
    WHERE (((Year([LAST DATE]))=2002));

Posting Permissions

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