UPDATE TopStudents
SET studentdetails = left(studentdetails, length(studentdetails) - 12)
WHERE 0 = 0

change the left and length functions according to your DB semantics.


-----Original Message-----
From: Srimanta B [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 1:54 PM
To: CF-Talk
Subject: SQL Question

Hello,

Can someone please help me.
I wish to delete part of a text in "student" field keeping part of the text
in the same field intact.

Database: Access.
Table name is: TopStudents
The field names are: studentid, studentdetails, percentage, grade.
The contents of the rows in the "studentdetails" field are similar to this:

Student Name1 - Year 1950
Student Name2 - Year 1953
Student Name3 - Year 1953
Student Name4 - Year 1953
Student Name5 - Year 1954

I have about 500 rows of data in the table.
What I wish to do is to keep the student names in the rows intact and delete
everything on the righthand side from the -.

Any help would be much appreciated.

Regards
SB
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to