SQL select problem

Results 1 to 2 of 2

Thread: SQL select problem

  1. #1
    Join Date
    Dec 1969

    Default SQL select problem

    Hi<BR>I need to create an SQL select statement which will return all records based on the first 3 letters of a record field value<BR><BR>ie <BR>Select all records where name = "Abb" from database sharenames<BR><BR>will return a list of records who&#039;s first 3 letter in the name field equal Abb<BR><BR>I am uses SQL7 as the database (ie T-SQL)<BR><BR>Can anyone help<BR><BR>thanks Jonny<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL select problem

    Use the online TSQL manual. I usually start here:<BR><BR>http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/sql/ts_tsqlcon_6lyk.htm<BR><BR>Look in the list of categories and functions (left hand pane). See "SUBSTRING". Click. See this page:<BR>http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/sql/ts_setu-sus_6btz.htm<BR><BR>SO...<BR><BR>SELECT * FROM table WHERE SUBSTRING( fieldname, 1, 3 ) = &#039;Abb&#039;<BR><BR><BR>Learn to use the online TSQL reference manual! It&#039;s really easy to find stuff in it and the examples are usually pretty good.<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts