473,516 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Switch() with numbers

I am adding Expressions to a query that assess a numerical field in
the query and return a numerical result. For example:
ColumnB: Switch([ColumnA]=1.95 or [ColumnA]=2.2, 1, [ColumnA]=1.74 or
[ColumnA]=3.2, 2) etc.
It may be relevant to say the results in ColumnB appear to be text
(they are left justified).
My problem is, naming ColumnB in another expression, for example
ColumnC: Switch([ColumnB]=1,0.55,[ColumnB]=2,1.15)
forces a textbox to prompt the user for the [ColumnB] value when you
run the query.
Obviously I do not want this to happen.
The answer may be to use nested IIF commands instead, but I am trying
to avoid this as the expressions are by necessity going to be very
long, and it will be a nightmare keeping a track of all those
brackets!
Any help accepted very eagerly.
Nov 12 '05 #1
0 1070

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
9555
by: clueless_google | last post by:
hello. i've been beating my head against a wall over this for too long. setting the variables 'z' or 'y' to differing numbers, the following 'if/else' code snippet works fine; however, the 'case' code snippet does not. (the code's function is illustrative.) ////////////////////////////////////////// //////// working 'if/else' switch...
4
1223
by: Arjen | last post by:
Hello, My datagrid shows some values out of a database. For example 1,1,2,3,2,3,4,1. Now these numbers are not realy nice... so I want to convert the numbers. If it is a 1 it must show cars. If it is a 2 is must show bikes. How can I convert this in C#?
1
5023
by: Berko | last post by:
I'm having problems with a switch statement that is wrapped in a foreach statement so that each index in an array is evaluated against the switch statement. The switch/case will then return some output for display. I have a long list of classes for the upcoming semester. Each one has a checkbox to the right that has the following code....
19
3772
by: rdavis7408 | last post by:
Hello, I have four textboxes that the user enters the price per gallon paid at the pump, the mileage per gallon and I would like to then calculate the cost per gallon and use a switch statement to pull a value based on the price per gallon. For example if the price of fuel is 2.44 per gallon and the enter that they get 5.9 miles per gallon...
133
6762
by: Alan Silver | last post by:
Hello, Just wondered what range of browsers, versions and OSs people are using to test pages. Also, since I don't have access to a Mac, will I have problems not being able to test on any Mac browsers, or is there some other way of checking? TIA --
1
7729
by: Thiero | last post by:
Hi I posted s thread but did have any reply, I am a new programmer and really wants someone to help me on how to use TreeMap for this code cos I want to it to be able to handle the options from 6 to 9 in the menu of options: /*the next method to be implemented is the method presentResultsToUser() which is expected to print a menu of...
9
1502
by: mantrid | last post by:
hello In the function below radtext is an array of 3 radio buttons with values set to 1, 2 and 3. but variables starty and finishy are not returned. ***************************************************** function show(ele,invele1,invele2,invele3,invele4) { switch (document.getElementById(radtext).value){ case 1: var starty=2; var...
0
1939
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use of string manipulation where they seek through the string back and forth doing replacements to substitute in the needed HTML code. I am convinced...
7
3349
by: Rohit | last post by:
Hi, I am working on a switch module which after reading voltage through a port pin and caterogizing it into three ranges(open,low or high), passes this range to a function switch_status() with parameters value and signal ID. Signal Id is used to get a user configurable parameter inside a configuration file, which depends on the type of...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7581
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.