Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

choose statement

Status
Not open for further replies.

NickMalloy

Programmer
Apr 15, 2005
68
US
I have ben trying to figure out how a choose statement works. I haven't been able to find any documentation on it. Say I have a case statement that I know wont work in jet SQL. In sql server it might look like this

tbltest.field1,

case field1
when '1' then 'pos'
when '2' then 'neg'
when '3' then 'NA'
when '4' then 'Unk'

end as field1pnt,

If I convery it over to a choose statement like this

Choose(field1, "pos", "neg", "NA", "Unk") as field1Pnt,

How does it match up the information. How does it know that 2 should be neg and so forth??? I don't quite understand.
 
So you've got it working, but don't know how?

The help files -> enter VBE through either ALT+F11 or CTRL+G, type Choose, then hit F1. Should be both a better explanation than I can provide, and a sample.

Roy-Vidar
 
The Choose function, is a VBA function, not a part of SQL. And you should be able to use in Jet SQL, just as you use UDF's (user defined functions) or other functions in SQL-server SQL.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top