Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
1.i want that my calculate members (cdate(date())) it is called Todaywill be in format mm/dd/yyyy 2.i have a measure Mydate of type varchar , i want it will be in format mm/dd/yyyy
rajdaksha
Aged Yak Warrior
595 Posts
Posted - 2009-12-06 : 04:59:56
HI Try this...
CREATE TABLE #TEMP(ID INT IDENTITY(1,1), DATE VARCHAR(12))INSERT INTO #TEMPSELECT '11-05-1983' SET DATEFORMAT MDY -- Month, Date, YearSELECT CAST(DATE AS DATETIME) FROM #TEMPSET DATEFORMAT DMY -- Date ,Month ,YearSELECT CAST(DATE AS DATETIME) FROM #TEMPDROP TABLE #TEMP
-------------------------R...
JCirocco
Constraint Violating Yak Guru
392 Posts
Posted - 2009-12-06 : 16:30:03
Or in SSRS you can just use the Format attribute in properties and enter the code MM/dd/yy. Make sure you have MM capitals as lower case indicates milliseconds and not MonthsJohnIt's a small world (but I wouldn't want to paint it)
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2009-12-07 : 02:45:25
quote:Originally posted by rajdaksha HI Try this...
CREATE TABLE #TEMP(ID INT IDENTITY(1,1), DATE VARCHAR(12))INSERT INTO #TEMPSELECT '11-05-1983' SET DATEFORMAT MDY -- Month, Date, YearSELECT CAST(DATE AS DATETIME) FROM #TEMPSET DATEFORMAT DMY -- Date ,Month ,YearSELECT CAST(DATE AS DATETIME) FROM #TEMPDROP TABLE #TEMP
-------------------------R...
This question is posted in Reporting Services Forum. So better method is to format in the report intself than in t-sql MadhivananFailing to plan is Planning to fail
JCirocco
Constraint Violating Yak Guru
392 Posts
Posted - 2009-12-07 : 08:23:06
quote:Originally posted by JCirocco Or in SSRS you can just use the Format attribute in properties and enter the code MMddyy. Make sure you have MM capitals as lower case indicates milliseconds and not MonthsJohnIt's a small world (but I wouldn't want to paint it)
JohnIt's a small world (but I wouldn't want to paint it)