473,383 Members | 1,877 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,383 software developers and data experts.

Recode text to numeric

Suppose I have a field (column) called "gender" with values "male",
"female", and "unknown".
How can I write a *query* that will change these responses to a numeric
format with values of 1, 2, and 3, respectively?

Sep 6 '06 #1
3 3225

atarb...@gmail.com wrote:
Suppose I have a field (column) called "gender" with values "male",
"female", and "unknown".
How can I write a *query* that will change these responses to a numeric
format with values of 1, 2, and 3, respectively?
use a nested IIF statement
IIF(Gender="Male",1,IIF(Gender="Female,2,3))

Sep 6 '06 #2
at******@gmail.com wrote:
Suppose I have a field (column) called "gender" with values "male",
"female", and "unknown".
How can I write a *query* that will change these responses to a numeric
format with values of 1, 2, and 3, respectively?
You could enter
1;"Male";2;"Female";3;"Unknown"
and change the column count to 2 and bind to column1 and set column 1
width to 0 and column 2 width to 1 as in
0;1
Sep 7 '06 #3

salad wrote:
at******@gmail.com wrote:
Suppose I have a field (column) called "gender" with values "male",
"female", and "unknown".
How can I write a *query* that will change these responses to a numeric
format with values of 1, 2, and 3, respectively?
You could enter
1;"Male";2;"Female";3;"Unknown"
and change the column count to 2 and bind to column1 and set column 1
width to 0 and column 2 width to 1 as in
0;1
Not sure if it's senility or what... I'm either to senile or too
impatient to read the question carefully... time for glasses or
something...

Sep 7 '06 #4

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

Similar topics

1
by: Gema Gema | last post by:
I have a large collection of directories full of various files and am looking to create custom text files for the contents of each directory. Here is the situation: The directories are named...
3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
3
by: Tron Thomas | last post by:
What does binary mode for an ofstream object do anyway? Despite which mode the stream uses, operator << writes numeric value as their ASCII representation. I read on the Internet that it is...
2
by: sara | last post by:
I have a mess on my hands. I have a whole set of queries and reports (almost a whole app, really) that has "location" as a text field. Sometimes it's a number and a few times it's text (001, 002,...
2
by: Terry | last post by:
Howdy, I'm having trouble getting a message to appear in a label. I have the following code snippet: lbErrorMssg.Text = "" foreach (DataRow Rrow in ds.Tables.Rows) { string sString =...
14
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I...
12
by: Frederik Vanderhaeghe | last post by:
Hi, I have a problem converting text to a double. Why doesn't the code work: If Not (txtdocbedrag.Text = "") Then Select Case ddlBedrag.SelectedIndex Case 0 Case 1
2
by: Eric West | last post by:
Hello all- When I attempt to configure php with the recode library I get the following error: configure: error: recode extension can not be configured together with: mysql Here's my...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...

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.