Thread: ms sql syntax

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    2
    Rep Power
    0

    ms sql syntax


    hi all,
    I need help translating some ms sql syntax
    can anyone tell me what the folloing line means?
    I've never worked with ms sql before, currently I have to translate a given ms sql db schema into mysql. Can anyone help?

    Thank

    ----------------------------

    "SELECT DB,ACCNT_CODE, ACCNT_NAME, ANL_A1, ANL_A2, ANL_A7, DB_FLAG, CONVERT(VARCHAR,DATE_FOR_ACTION,103) AS DATE_FOR_ACTION FROM SSR WHERE ACCNT_CODE='" & strID & "'"
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,593
    Rep Power
    4207
    I expect you're trying to figure out what CONVERT(VARCHAR,DATE_FOR_ACTION,103) means. The CONVERT function is used to convert one data type to another. In this case, it is converting the DATE_FOR_ACTION column to a VARCHAR data type. When converting a date type to a char or varchar type, you can optionally specify a third parameter, which defines the format of the conversion. In this case 103 means, convert to UK date format of dd/mm/yyyy. See http://msdn.microsoft.com/library/de...ce_convert.asp for more info.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    25
    Rep Power
    0
    thanks Scorp..
    I got it.. and to do it in mysql I'm using DATE_FORMAT().

    thanks again.

IMN logo majestic logo threadwatch logo seochat tools logo