Hi, I have to form a sql in my VB code and pass to it to Sql server to execute. In my where clause i need to format the date as mm/dd/yy. In the server database it is stored as mm/dd/yy hh:mm:ss. Can someone tell me how to do it. format and date_format functions are not available.
Piyush
Try this:
select Cast(DATEPART(m,tbOrderStatus.TimeStamp) as varchar) + '/' + Cast(DATEPART(d,tbOrderStatus.TimeStamp) as varchar) + '/' + Cast(DATEPART(yyyy,tbOrderStatus.TimeStamp) as varchar) "DateStamp"
-David