473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

display in a column format

I have 2 tables - Master plan table and detail table. The plan number is unique in Master plan table and repeats in detail table. There is another column in detail table called planrefnumber that is text, contains values such as 'myp-01-pcs', 'myp-02-pcs', 'myp-03-pcs' and so on.

Based on the value of the column 'planrefnumber', I want to display a new column that has a 'yes' if planrefnumber = 'myp-01-pcs'. If planrefnumber = 'myp-02-pcs', it should display 'yes' and so on.

Also, is this possible to display all of this in a columnar format, i.e.

plan number planrefnumber disp1 disp2 disp3
H1234 myp-01-pcs yes no no
H1245 myp-03-pcs no no yes

Help will be appreciated!

Thanks.
Mar 20 '08 #1
1 1329
janders468
112 Expert 100+
What you could use is an immediate if (iif). I don't know how you plan to implement this but I would not alter the structure of your table to add these columns. Instead I would create a query that has your planrefnumber column and have three columns in the query that utilize the immediate if.
i.e.
Expr1: iif([planrefnumber]= 'myp-01-pcs', "Yes", "No"

Add a column like that for each of the values you would like to test (You can call it anything I used Expr1 as that is what access defaults to). The iif works like this: the first argument is an expression that evaluates to true or false. In our case that expression is [planrefnumber] = 'myp-01-pcs' the next argument is what it should do if this expression evaluates to true. In our case we want it to display "yes". The next argument is what to display if the expression evaluates to false. In our case this is "No". If you really want to add these columns to your table (which I can't see any good reason for doing) then use the same logic but instead of a select query use an update query and update the columns you have added to your table with the iif expression.

Hope that helps
Mar 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Dan Matthews | last post by:
Hey everybody, I have an 2000 Access database that stores job listings from potential employers for a school. I would like to be able to display the date on a webpage the last time the database...
3
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a...
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
7
by: Tarren | last post by:
Hi: I am pulling duration out of my DB and it returns duration in seconds. For the display i would like to show it in time format with colon So duration of 221 I want it to display 03:41 ...
2
by: Olav Tollefsen | last post by:
I'm creating an ASP.NET e-commerce web site and I have to conditionally (depending on site / user settings) display prices either excluding or including tax. Prices are typically read from a...
2
by: Rahul | last post by:
Hey Guys I have a development environment, in which the whole SQL syntax is stored in the Database. So the syntax in the databse column could be "where BirthDate = '12/31/2005' and ID =...
0
by: Curious | last post by:
Hi, I have two columns in a grid defined as DateTime type. Currently, they're both displayed in the format of "5/23/2007", for an example. It seems that they're using the default "short date"...
4
by: cheltboy | last post by:
At one of my client sites we noticed a few weeks ago that Listboxes which previously showed "Yes" or "No" are now showing "-1" or "0". The underlying tables and queries are displaying True/False...
2
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
I have a character(15) column filled with numbers, in my SQL database. I need it to display like it does in Access when I set a format for the column, like "000-000-000-000-000". How do I display...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...
0
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...

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.