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.
| Author |
Topic |
|
zeus2026
Starting Member
11 Posts |
Posted - 2009-04-06 : 01:06:12
|
| SELECT EmployeeName, CONVERT(varchar, DateHired, 101) AS DateFROM viewEmployeeWHERE (DateHired >= '5/01/08') AND (Separated = 0) AND (DeptID < 39)ORDER BY DateHiredin this code i want to view all the employee where 5 months contract has been done in the months of April, 2009 but I should view the table with no specific date.. like thisEmployeeName DateHiredMarlon 11-2008please kindly help me huhuh. Thanksz3us |
|
|
matty
Posting Yak Master
161 Posts |
Posted - 2009-04-06 : 01:31:26
|
| SELECT EmployeeName, RIGHT(CONVERT(varchar, DateHired, 105),7) AS DateFROM viewEmployeeWHERE (DateHired >= '5/01/08') AND (Separated = 0) AND (DeptID < 39)ORDER BY DateHired |
 |
|
|
zeus2026
Starting Member
11 Posts |
Posted - 2009-04-06 : 01:35:33
|
| thnx sir..z3us |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-04-06 : 05:18:14
|
| If you want to show formatted dates in front end application, do formation thereMadhivananFailing to plan is Planning to fail |
 |
|
|
nishita_s
Yak Posting Veteran
61 Posts |
Posted - 2009-04-06 : 05:41:17
|
| SELECT EmployeeName, CAST(MONTH(DateHired)AS VARCHAR(2)) + '-' + CAST(YEAR(DateHired)AS VARCHAR(4)) AS DateFROM viewEmployeeWHERE (DateHired >= '5/01/08') AND (Separated = 0) AND (DeptID < 39)ORDER BY DateHired |
 |
|
|
|
|
|