Converting type; text to check box in a query

G

Guest

Converting type; text to check box in a query

I have a table that has a field [Status], where M = Married and S = Single.
I want to run an append query that that is taking this data and putting it
into another table where [Status] is a Check Box rather than a text value.
How can I convert this in my SQL or do I have to do some thing with
recordsets or such?


I imagine there has to be some function like

Expr1: changeType([Status], changeToCheckBox, where M = True)

Probably there isn’t, but a man can dream.

Thanks,
Phil
 
J

John Spencer (MVP)

Simplest way'
Expr1: [Status]="M"

That will return True when Status = "M" and False when Status = any other value
(except NULL), so you might need to use

Expr1: NZ([Status],"S")="M"
 
G

Guest

This is great! I didn’t think it was going to be possible. Thanks a ton!

I can’t use that in my append query, but it’s easy in a update query. I
just need to make my code insert a new field to the table, run the update
query and then append that to the table I want.

Thanks!!!

John Spencer (MVP) said:
Simplest way'
Expr1: [Status]="M"

That will return True when Status = "M" and False when Status = any other value
(except NULL), so you might need to use

Expr1: NZ([Status],"S")="M"

Converting type; text to check box in a query

I have a table that has a field [Status], where M = Married and S = Single.
I want to run an append query that that is taking this data and putting it
into another table where [Status] is a Check Box rather than a text value.
How can I convert this in my SQL or do I have to do some thing with
recordsets or such?

I imagine there has to be some function like

Expr1: changeType([Status], changeToCheckBox, where M = True)

Probably there isn’t, but a man can dream.

Thanks,
Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top