November 2nd, 2003, 04:48 PM
ms sql syntax
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?
"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 & "'"
November 2nd, 2003, 09:13 PM
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
November 4th, 2003, 11:49 PM
I got it.. and to do it in mysql I'm using DATE_FORMAT().