Results 1 to 4 of 4
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    How Can I Create This Query

    I a query containing 3-text fields & 5-number fields which are ALL SumOf… In my 1-text field I have it as the months (Feb). My query looks something like:



    Months Text-A Text-B SumOf-Z SumOf-X SumOf-Y etc…

    I’m trying to create another query that shows me ALL of the Sums based upon certain months.

    First thing, in Query Design & the “Month” grid I already know that you need to check off the show box.

    I’ve tried ALL of criteria’s which won’t work. In the “Month” grid I tried:
    1. = “Oct” =”Nov” =”Dec”
    2. Between “Oct” And “Dec”
    3. =>"Oct" And <"Dec"

    *As you may see I’m trying to retrieve the Sums of Oct thru Dec & I’m having no luck.

    Any assistance would be appreciated!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Because you have alphabetic months, I doubt Between or the >= tests will work. You see them as months but Access sees them as text values. You probably want to switch to numeric values 1-12. In any case, the first would probably work if you did:

    In(“Oct”, ”Nov”, ”Dec”)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Still isn't Working

    Ok, I added anotherfield to my table with the month in numbers. when i triedrunning a query trying to retrie the sums of certain months I have no luck.

    I tried these following criteria's:
    1. ="10;" ="11;" ="12"
    2. Between "10" And "12"
    3. Between 10 And 12
    4. => 10 And <1
    ...?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    1 is incorrect syntax, you'd need OR or the IN clause I showed before. If your values are numbers, 2 wouldn't work because you've enclosed the values in quotes. I would expect 3 to work, so perhaps you can post the full SQL or a sample db. 4 wouldn't work because no number is both greater than 10 and less than 1.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. how create this query???
    By daniel.preda in forum Queries
    Replies: 7
    Last Post: 12-28-2010, 03:27 PM
  2. How to create a invoice of my query?
    By DarrenReeder in forum Reports
    Replies: 3
    Last Post: 12-01-2010, 10:00 AM
  3. How do i create a new field in a query
    By jayjayuk in forum Access
    Replies: 3
    Last Post: 10-12-2010, 09:06 AM
  4. How do i create a new field in a query
    By jayjayuk in forum Access
    Replies: 1
    Last Post: 10-12-2010, 07:25 AM
  5. Using a query to create
    By DamnYankees in forum Queries
    Replies: 2
    Last Post: 10-08-2009, 07:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums