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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Substrings with SQL fields

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I have this Intranet running my ASP page. My problem might be a small one for you experts, but its killing me.


I have a field called Destination. It includes to much data approx 200 characters. I want to reduce the number of characters say like view only the last 50 on the intranet. Its coming from an Access database. I tried Right() Left() but nothing seems right. I go to the ASP code and this is what I do.


Select right(Destination,20) from Travel

with destination being my field name.

Above is just a rough example of what I am doing. I am going directly into notepad and making the changes. Please help.

Thanks
 
Well, Unsure why you need to cut down to only 50 characters, but try just selectiong the entire field and then doing the right() on it after you have received it into your recordset. As far as I know, SQL doesn't support substring manipulation. You will have to do that with your ASP code after executing your query and receiving back your recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top