Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    2

    Unanswered: Single report multiple query

    Software: Office Access XP/2002
    Here’s the issue: I want to make one query that will do three things with one single criterion.

    I have a table named membership running under a form named membership with fields; hisfirstname – herfirstname – lastname – marragedate – yearsofmarriage (a calculated field) – hisbirthdate – hisage (a calculated field) – herbirthdate – herage (a calculated field). Of course there are many other fields but the above is the basis of the query. The type of fields are names = text, dates = time/date, and ages = number. Now, let’s say I have 300 records with the above info. capturing correctly and I want the Query to find ALL his birthdays in December and ALL her birthdays in December and ALL anniversaries in December in ONE Query.

    I can accomplish this using one query for each item, etc his birthday which gives me 36
    Queries and 36 reports.

    I want ONE query to generate a report something like this:

    His and Her Name Anniversary Years of Marriage His Name
    Their Names mmmm dd calc Name
    His Birthday His Age Her Name Her Birthday Her Age
    mmmm dd calc Name mmmm dd calc



    The query would call multiple fields with one thing in common, a month i.e. December.

    Thanks D-C-W

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Welcome to the forums

    Look at using a JOIN statement in your report's SQL (or create a fourth query, store it, and base the report on it, whichever).
    Me.Geek = True

  3. #3
    Join Date
    Aug 2009
    Posts
    2
    Thanks - I will give it a try tomorrow.

    D-C-W

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Code:
    SELECT ... WHERE ((DatePart("m", [hisbirthdate])=12) OR (DatePart("m", [herbirthdate])=12) OR (DatePart("m", [marragedate])=12))
    Have a nice day!

Posting Permissions

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