Compare Month

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barkarlo
    New Member
    • Nov 2006
    • 59

    #1

    Compare Month

    How Can I Compare Data For The First Four Month In 2006 And 2007.
    I Make Crosstab Query But I Do Not Know How Make Appropriate Parameters
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    You have (accidentally) posted this question in the Access Articles section. This is NOT an article.
    I'm moving this to the main Access questions forum.

    MODERATOR.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32669

      #3
      You ask the question but you give us very little idea of what you're working with.
      Perhaps posting the SQL may help, but also try to explain what you're trying to do a bit more clearly.

      Comment

      • barkarlo
        New Member
        • Nov 2006
        • 59

        #4
        Originally posted by NeoPa
        You have (accidentally) posted this question in the Access Articles section. This is NOT an article.
        I'm moving this to the main Access questions forum.

        MODERATOR.
        I want make query where I want to see total income from january, february, march,april 2006, and total income from january, february,march, april 2007.

        Comment

        • nico5038
          Recognized Expert Specialist
          • Nov 2006
          • 3080

          #5
          Guess you want always the "equal" months of the current year to be compared with those of last year.
          To get them in a query use for the criteria (WHERE clause) to get them all:

          Code:
          between dateserial(year(date),1,1) and dateserial(Year(date)),Month(date),0) OR
          between dateserial(year(date)-1,1,1) and dateserial(Year(date)-1),Month(date),0)
          This will test the dates to fall between the first of january and the last full month.
          The Dateserial expects strings (or numbers) for Year, Month and Day. Day=0 is a trick to get the last day of the previous month :-)

          Nic;o)

          Comment

          • barkarlo
            New Member
            • Nov 2006
            • 59

            #6
            Originally posted by nico5038
            Guess you want always the "equal" months of the current year to be compared with those of last year.
            To get them in a query use for the criteria (WHERE clause) to get them all:

            Code:
            between dateserial(year(date),1,1) and dateserial(Year(date)),Month(date),0) OR
            between dateserial(year(date)-1,1,1) and dateserial(Year(date)-1),Month(date),0)
            This will test the dates to fall between the first of january and the last full month.
            The Dateserial expects strings (or numbers) for Year, Month and Day. Day=0 is a trick to get the last day of the previous month :-)

            Nic;o)
            When I run query I would like to see table for period 01.01.-05.01.
            account name account 2006 [B] 2007 ind 07/06 419100 sales apple 100 (euro) 150 (euro) 150
            420000 sales pear 1200(eiro) 850(euro) 70
            How can I do it
            I am try with crosstab query but I can't extract given period

            Comment

            • nico5038
              Recognized Expert Specialist
              • Nov 2006
              • 3080

              #7
              First make a query with the BETWEEN clause needed.
              Than save that e.g. named qry20070105
              Finally use that query for your crosstable query.

              Nic;o)

              Comment

              Working...