Monday, November 18, 2013

SQL Restrict Number of Characters

I have used the 'left()' function to limit the results of a query in the past, but sometimes it does not work. The other function that can be used to limit the results of a query is substring, here is how it is used:

select Substring(notes,1,4000) as notes from history

Where the 1 is where you start and the 4000 is how many characters you want to pull in.

SUBSTRING ( expression ,start , length )

No comments:

Post a Comment