473,396 Members | 1,924 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.

finding value for check box

I need some help in figuring out how to return the value of a check box. I am trying to migrate data from access to sql server 2000. One of my access table contains check box option: a user can select or it is not selected. The problem is that sql server takes that field as null.
Now I am trying to get the value of the check box; something like "0" if not checked and "1" or "-1" if checked. If I can translate to some value, then I am fine with that and can store the same values in sql server.
In order to do that I am trying to use expression builder (IIF function), however, can't seem to figure out how to use an expression to relate check or uncheck option.
Can anyone help me in this regard ?
Thanks
Jul 11 '07 #1
7 5189
JKing
1,206 Expert 1GB
For the yes/no field 0 = no or false and -1 = yes or true. A quick fix I can think of is simply changing the field data type from Yes/No to Number. This should convert any records with the field checked to -1 and any unchecked to 0. Make sure to backup and save before attempting this.
Jul 11 '07 #2
Rabbit
12,516 Expert Mod 8TB
I need some help in figuring out how to return the value of a check box. I am trying to migrate data from access to sql server 2000. One of my access table contains check box option: a user can select or it is not selected. The problem is that sql server takes that field as null.
Now I am trying to get the value of the check box; something like "0" if not checked and "1" or "-1" if checked. If I can translate to some value, then I am fine with that and can store the same values in sql server.
In order to do that I am trying to use expression builder (IIF function), however, can't seem to figure out how to use an expression to relate check or uncheck option.
Can anyone help me in this regard ?
Thanks
Try
Expand|Select|Wrap|Line Numbers
  1. iif(CheckboxFieldName, 1, 0)
Jul 11 '07 #3
Expand|Select|Wrap|Line Numbers
  1.  
  2. SOW: IIf([SOW],-1,0)
  3.  
I am still struggling with IIF statement: the error suggests the circular reference, any help ?
"Circular reference caused by alias 'SOW' in query definition's SELECT list"
Jul 11 '07 #4
okay, that circular reference is settled, i used
Expand|Select|Wrap|Line Numbers
  1.  
  2. SOW: IIf([Design and Qualification].[SOW],-1,0)
  3.  
but now another problem: It is displaying all as -1, i guess because it is looking at the check box field and is returning true for that.
My problem is to find the field checked or un checked and accordingly assign -1 for checked and 0 for un checked.

Need some help here,
Thanks
Jul 11 '07 #5
Rabbit
12,516 Expert Mod 8TB
okay, that circular reference is settled, i used
Expand|Select|Wrap|Line Numbers
  1.  
  2. SOW: IIf([Design and Qualification].[SOW],-1,0)
  3.  
but now another problem: It is displaying all as -1, i guess because it is looking at the check box field and is returning true for that.
My problem is to find the field checked or un checked and accordingly assign -1 for checked and 0 for un checked.

Need some help here,
Thanks
try CheckboxName = True instead.
Jul 11 '07 #6
thanks a lot for the help, case is resolved.
Actually I was using the wrong table name :), my bad. It works fine now.
The "IIF" sttement suggested earlier is right, I was wrong.
God Bless
Jul 11 '07 #7
Rabbit
12,516 Expert Mod 8TB
Glad you got it working, good luck.
Jul 11 '07 #8

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

Similar topics

2
by: Greg | last post by:
Hi. I have a rather large xml document (object) that can have one or more nodes with a certain attribute throughout (at ANY depth, not at the same level necessarily). I need to find this...
6
by: GSpiggle | last post by:
I have a database with records that should have a consecutive number ID (Check Register). Also has other records (deposits and adjusting entries) that don't fit in the number range so...
9
by: Laurent Bugnion | last post by:
Hi, I am wondering what is the best way to find out which ASP.NET sessions are still active. Here is the reason: I have a custom control which can upload files. It saves the files in a folder...
2
by: ElkGroveR | last post by:
Hi there! I'm using PHP to create a simple, dynamic MySQL SELECT query. The user chooses a selection from a HTML Form SELECT element's many options and submits the form via a POST action. ...
1
by: Darren Mar-Elia \(MVP\) | last post by:
This is the situation I have. I have to read 8 registry values and assign them to variables. The value held in each of those variables corresponds to a different flag. So, for example, one set of...
8
by: Jerim79 | last post by:
I am working on a script that will query a database for a FNAME/LNAME combo. If it finds the combo, I need it to do one set of instructions. If it doesn't find it, I need it to do something else....
7
by: Brad Baker | last post by:
I am trying to programmatically set a placeholder control in csharp which is nested inside a repeater control between <ItemTemplateand </ItemTemplate> tags, however I am running into problems. I've...
21
by: Tom Gur | last post by:
Hi, It's seems that csh and tcsh acts a bit different when handling special characters in quotes. i.e: if i'll supply my program with the following arguments: -winpath "c:\\temp\\" tcsh will...
15
by: timothytoe | last post by:
Situation: I have an array of objects. I want to find the maximum value of a given numeric value that exists in each of the objects. Suppose the array of objects is called "stat" and the numeric...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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
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...
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,...

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.