|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Cast/Convert
I want to convert the date to a certain format but I'm having problems with the correct syntax.
SELECT DISTINCT Convert or Cast (actualclosingdate , 101) AS 'Closing Date', Convert or Cast (lmloanrate, 2) AS 'Interest Rate' |
|
#2
|
|||
|
|||
|
Sorry I forgot to explain in more detail. I want my actualclosingdate to be shorten from
2004-05-10 00:00:00.000 to MM/DD/YY. I thought Cast (actualclosingdate , 101) would give me the results but I get an error, and the Interest Rate to be down to 2 decimals -> Cast (lmloanrate, 2) AS 'Interest Rate'. Any suggestions? |
|
#3
|
||||
|
||||
|
For date
Code:
SELECT CONVERT(varchar(11), GetDate(), 101) As 'Today' For decimal Code:
SELECT Cast('6.5508' As dec(4,2)) As 'Interest Rate'
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Cast/Convert |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|