Results 1 to 3 of 3
  1. #1
    juanmatos is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    1

    Access Query Question

    Good afternoon everyone.



    I'm sooo stuck here at my new job and I hope somone here can help me. I have a report to do in Crystal off of an Access 2010 database and the requirement seems impossible. I need to be able to prompt for a quarter and return the output. We don't store quarters such as 1,2,3,4. Instead we store periods which are really months. So we store 1,2,3....12. I've tried just about every possible angle in CR and I just simply need to try a different approach. What I want to try now is a query that somehow brings back just the periods I need. Is this possible? Suppose I have a table named invhdr and it has fields InvNum, billname, invPer, InvYr. InvPer is the periods column. I would have to join this table to the invDetail table on invNum. Any chance someone can help me with this?

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Post some dummy data of the 2 tables involved & some one should be able to help.
    Meanwhile, till some one comes along,
    Check out if you can use something like IIf , in the source query, something like
    If (InvPer = 1 or 2 or 3) then
    Quarter = Q1
    else if (
    InvPer = 4 or 5 or 6) then
    Quarter = Q2
    etc

    Thanks

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sounds like you need to calculate the quarter based on the period (month).

    Create field in query with expression:
    InvQtr: Choose([InvPer]<=3,1, [InvPer]<=6,2, [InvPer]<=9,3, [InvPer]<=12,4)

    Apply quarter filter criteria to that constructed field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Access 2010 Delete Query Question
    By scheibla in forum Queries
    Replies: 3
    Last Post: 05-01-2012, 08:34 PM
  2. Query Question (new access user)
    By lewismk in forum Queries
    Replies: 2
    Last Post: 01-05-2011, 08:21 PM
  3. Help!!! Urgent Access SQL Query Question
    By pinecrest515 in forum Queries
    Replies: 1
    Last Post: 12-06-2010, 02:40 PM
  4. Nested Query Question Access 2007
    By databased in forum Queries
    Replies: 5
    Last Post: 10-15-2010, 07:22 AM
  5. Access Query Question
    By seckerman in forum Queries
    Replies: 1
    Last Post: 09-16-2009, 08:50 AM

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