Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6117145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:17:13+00:00 2026-05-23T15:17:13+00:00

I have a switch statement in a crosstab query: Switch([Age]<20, Under 20, [Age]>=20 and

  • 0

I have a switch statement in a crosstab query:

Switch([Age]<20, "Under 20", [Age]>=20 and <=25, "Between 20 and 25") 
AS **Age_Range**

The switch statement evaluates my row heading like this:

                               1       2        3        4        5   <-- Columns


Under 20                       0       0        0        3        2

Between 20 and 25              1       2        0        4        0

Where the value =

Total: Nz(Count(Demo.ID))+0

Okay, all is good so far. However, I am trying to make a left join with the switch statement so ALL of the age ranges will show up, regardless of whether or not there is data. I know I need a table with all of the age ranges, but I am confused.

Here is what I have tried that is currently not working.

  1. Joining the switch statement Age_Range to the table Age Range, where the correlating values in the table are the “Under 20” and “Between 20 and 25” strings in the switch. Not working.

  2. Instead of putting the string values in the table, putting the conditions ([Age]<20, etc). However, this fails because in order to put the conditions in the table, it has to be a text field. There is a data mismatch.

Can someone please let me know if this can be done and how?

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:17:13+00:00Added an answer on May 23, 2026 at 3:17 pm

    Make the crosstab a separate query. Then left join that query to your table of item in #1 (“Under 20” and “Between 20 and 25”).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I have a switch statement like this: ... switch (temp) { case NW
I have a switch statement in a Crystal Report that looks like this: stringvar
I have a switch statement similar to this one: switch (number) { case 1:
I have kept hearing this statement. Switch..Case is Evil for code maintenance, but it
In a switch statement inside a bool function I have this. Do I add
What is the best way to reuse switch logic. I have this switch statement
I have this code with the switch statement which I got from this post
I have a switch statement acting as a menu, in this I am trying
Let's say that I have a switch statement in my thread function that evaluates
I have this switch statement in my code: switch(buttonIndex){ case 0: [actionSheet dismissWithClickedButtonIndex:buttonIndex animated:YES];

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.