Had to change query to use date field

  • Hi,

    I needed to change part of my query to use a date field now I can't get it to work:

    This is the original (works)

    select left(substring(pehPErcontrol,5,len(pehPErcontrol)),2) as name from pearhist

    This one no work:

    select left(substring(cast (pehpaydate as varchar)(pehpaydate,5,len(pehpaydate)),2) as name from pearhist

  • this may work for you. hard to tell without table structure and sample data. read the link in my signature on how to post to get the best help

    select left(substring(cast (pehpaydate as varchar),5,len(pehpaydate)),2) as name from pearhist

    Bob
    -----------------------------------------------------------------------------
    How to post to get the best help[/url]

  • Thanks Bob..that works.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply