By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,397 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,397 IT Pros & Developers. It's quick & easy.

Help needed in query

P: n/a
Hi

I 've a mdb which has one table and the structure would be

tab1
----

no integer
ch char(1) may hold either 'a' or 'b' OR 'C'

------------------

IF I SELECT THE ABOVE TABLE Tab1 thru query in Data environemnt of
VB6.0 i NEED THE RESULT TO DISPLAY ALL THE RECORDS(ABBRIVATION) LIKE
THE

NO CH
-------------
1 APPLE 'FOR VALUE 'A'
2 BOY 'FOR VALUE 'B'
3 CAT 'FOR VALUE 'C'

HOW TO DO THIS IN ACCESS (IS THERE IS ANY 'SELECT CASE ')

With Regards
Raghuraman
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

There is a Text manipulation function in Access using which you can
change the case of the string or char in the database.
It is Ucase. You will use it like Ucase( tb1.fieldname).

The opposite function is Lcase.

HTH
Nov 12 '05 #2

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Use the Access built-in function IIf(). E.g. (watch out for line
wrap):

IIf(Value="A","Apple", IIf(Value="B","Boy",
IIf(Value="C","Cat","Unknown")))

You can also use the Switch() function (easier). E.g.:

Switch(Value="A","Apple", Value="B","Boy", Value="C","Cat")
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQEZet4echKqOuFEgEQL5zwCeLVPuVCkF/vno2bXeP9/uXvdZ+7YAnjJF
ffYJcL+J0hG/cyD8ZGPd/CNZ
=fZuh
-----END PGP SIGNATURE-----
Raghuraman wrote:

< SNIP >

NO CH
-------------
1 APPLE 'FOR VALUE 'A'
2 BOY 'FOR VALUE 'B'
3 CAT 'FOR VALUE 'C'

HOW TO DO THIS IN ACCESS (IS THERE IS ANY 'SELECT CASE ')


Nov 12 '05 #3

P: n/a

Hi,

Thanks all to the reply.

I am bit satisfied by the IIF & SWITCH Functions and i shall also try.
Could u please tell me how to use these functions in the sql-statement
of Data environment, that would better satisfy me.
With Regards
Raghu

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.