Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to get date format only in data base: below is my code I need only for data formats in Reported Date but it showing data and time format

SQL
Select A.DocEntry As 'CallId', B.UserName As 'UserName', C.ClientName As 'ClientName', A.RpDateTime As 'ReportedDate',
  A.CallSubject As 'Subject', A.CallDescription As 'IssueDetails', A.Priority, A.CallType, A.[Status],
  DATEDIFF(Day,  A.RpDateTime, GetDate()) As 'Age',D.ConsName AS 'ActionTakenBy', A.RspDateTime As 'ActionTakenat' ,A.FeedBack
  From BUSON_CALLLOG A
  Inner Join BUSON_USER B On A.UserId = B.UserId
  LEFT OUTER JOIN BUSON_CONSULTANT D ON A.ActBy=D.UserId
  Inner Join BUSON_CLIENT C On B.ClientId  = C.ClientId
Posted

Try Casting as Date...
SQL
Select Cast(Getdate() as Date)

Better to Check the link in answer1... it's Very helpful....
 
Share this answer
 
 
Share this answer
 
Comments
Maciej Los 7-Jul-13 7:44am    
Good link, +5!
Raja Sekhar S 9-Jul-13 3:29am    
Good one.... +5..!
jaideepsinh 9-Jul-13 3:34am    
Good link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900