Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2015
    Posts
    4

    Unanswered: print last two years

    i have query like
    Click image for larger version. 

Name:	untitled.JPG 
Views:	5 
Size:	24.7 KB 
ID:	16140
    how can i print last two years for Each one
    thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    its all down to your where clause
    eg
    WHERE year(mydate) >= year(NOW()) - 2

    or use the dateadd function

    or the datediff for that matter...
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2015
    Posts
    4
    it's
    year(mydate) >= year(NOW()) - 2
    work
    without where
    thanks

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    If you are using a query then the WHERE clause is required.
    if you are using the query designer then it idnt as when the designer completes it adds the various items requitrequired for a SQL query. I appreciate I am being a bit! pedantic here but that is the nature of the computer world. There is a world of difference between using the query designer to design a query and writing a query
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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