plsql Substring function [message #194883] |
Mon, 25 September 2006 21:38  |
yguyon
Messages: 1 Registered: September 2006
|
Junior Member |
|
|
In my database table, there is one field for the employee name in the order of (
LastName,FirstName) Example (Brian,Robbin,D) and I have another field for the Address in order of (City State Zip) Example (Clinton Twp Mi 48045).
Bellow I have a SQL query that actually work but what I need to do is to incorporate into this query where only the LastName is selected and where only the zip code is selected.
I believe I have to write a subtr clause for the zip but how to just select the lastname and not the LastName and full name.
Querry
------
Select Ballots.FULLNAME,
Ballots.ROWID,
Ballots.DATE_RETURNED,
Ballots.DATE_SENT,
Ballots.APP_RETURNED
from ABSENTEE_BALLOTS Ballots
Where trim(upper(address1)) like trim (upper(:street))|| '%' and trim (upper(address2)) = trim(upper(:zip)) and trim (upper(FULLNAME)) = trim(upper(:name)) and to_char(dob)=:birthDate ||"
|
|
|
|
|
Re: plsql Substring function [message #195064 is a reply to message #194883] |
Tue, 26 September 2006 16:12  |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
While the query works, your database design is, for lack of a better word, horrible. NEVER place multiple pieces of information in a single field. It causes nothing but headaches.
|
|
|