• DBA (5/21/2008)


    SELECT len as Length, p.productnumber,p.productID_PK AS ID

    FROM Products P

    WHERE p.Active = '0'

    (p.productname) = varchar (40)

    question, i know that with len(p.productname) i only get the count for characters without the spaces, how can i get the count with spaces?

    would this work?

    UPDATE Products SET Products.ProductName = RTrim([Products].[ProductName])

    FROM Products P

    WHERE p.Active = '0'

    To get the count with spaces, do something like "len(productname + 'x')-1".

    The second update should work, but you really don't need the From part of it. Just delete that line. (It will work either way, but the From isn't needed in this case.)

    As mentioned already, this may or may not actually solve your problem. To most SQL databases "xx " = "xx" (with or without trailing spaces). Try the rtrim update, see if that does it, but don't be too shocked if it doesn't.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon