Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: Multiple character separation

    Here's my situation, I have a database of stock trades that I need to separate into two lists. one containing trades in stocks that have 4 letters in thier symbols, and the other which has any trades in symbols that have 1,2,or 3 symbols.

    I cant seem to figure this one out, can anyone offer any help?

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Can you give an example of what is stored in your database and what you want the output to be ?

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    select * from trade_table where datalength(cast(stock_symbol as varchar(4))) = 4

    select * from trade_table where datalength(cast(stock_symbol as varchar(4))) < 4

  4. #4
    Join Date
    Dec 2003
    Posts
    2
    thanks, that looks to be exactly what I needed.

    -Chamber

Posting Permissions

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