In a sql server 2008 r2 database, I am trying to obtain just the date portion of a datetime field in mm/dd/yyyy format. I basically just do not want the time portion of this field.
I have used statements like select MONTH(pay_date) + '/' + DAY(pay_date) + '/' + YEAR(payment_date) from cust_table. I keep getting errors.
Can you tell me what is wrong with the above select statement and/or can you show me a different way to obtain only the date in a mm/dd/yyyy format?
Select date problem
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

SenthilkumarRank #387 · 6.5K reputationPosted Dec 8, 2011, 5:40 PM EST
You no need to do manually.
You can use the convert function with the codes.
SELECT CONVERT(VARCHAR,pay_date,101) FROM cust_table
Thanks,
Senthil.