Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Upper casing search keywords

Author  Topic 

IceWarrior
Starting Member

3 Posts

Posted - 2008-11-19 : 18:36:54
hello the title explains pretty much everything but i want to making a query using this code:
(microsft acess sql)

SELECT nome, lcase(name) as [new name]
FROM student
WHERE lcase(name) like "*" & [name?] & "*"

i want it when it searches for, lets say AU keywords i want it to uppercase every AU in the database

like this

the box prompts me for a value

i type in au

it searches the database and finds 2 values

Nascimento augusto
Jose Paulino

i want in the "new name" column to highlight the au in uppercase

like this

Nascimento AUgusto
Jose PAUlino

please help me asap

thanks

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2008-11-20 : 05:21:27
"I want in the "new name" column to highlight the au in uppercase"....

FRONT END, FRONT END, FRONT END.....using vb code, javascript, .Net code....or what ever you are doing. SQL doesn't do highlights. You'll also need to use some "string searching" construct like INSTR (depending on your development language)...to find where toserch string is occurring.

Have a look at the manual....if you want to learn you'll have to do some work at it yourself.
Go to Top of Page

IceWarrior
Starting Member

3 Posts

Posted - 2008-11-20 : 10:11:29
hmm i was also thinking sbout using instr.... ill see what i can do im still a beginner at this but "SQL doesn't do highlights" is a valuable information that means my teaher tricked me xD ill solve the problem from a different point of view now

ill report back later if i get something

(ok i did it it took me a while but i maneged to do it using mid to cut the string and instr to id where it should cut then assembleing everything again with &)

here is the code for whoever needs:

SELECT nome, lcase(mid(nome,1,instr(nome,[nome?])-1)) & ucase(mid(nome,instr(nome,[nome?]),len([nome?]))) & lcase(mid(nome,instr(nome,[nome?])+len([nome?]),255)) AS [novo nome]
FROM aluno
WHERE instr(nome,[nome?])>=1;



THANK YOU SO MUCH you anwser allowed me o think clearly and solve my problem
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2008-11-20 : 11:32:04
SQL is a data manipulation language.
highlights, etc is a presentation issue....
Go to Top of Page

IceWarrior
Starting Member

3 Posts

Posted - 2008-11-20 : 11:59:39
:)i already posted the solution thanks to you
Go to Top of Page
   

- Advertisement -