I cannot get the date format correctly in dynamic sql statement, after trying various ways of handling it. I need some help with the date format.
i am having a posting date field which is stored in sql db as yyyy-mm-dd format..and it displays in the asp web page as mm-dd-yyyy..i need to display the date in dd-mm-yyyy format..is there any way to do this?
this is my sql query:
SELECT CR.Name AS country,C.Name,C.[Name 2],C.[E-Mail],[Pre-Assigned No_], [Posting Date], SIH.[Currency Code], SIH.[Shipment Method Code],[Total Boxes],[ARE Net Wt],[ARE Gr_Wt], SIH.[Shipping Agent Code], SIH.[Payment Terms Code] FROM [Sales Invoice Header] SIH
INNER JOIN [Country_Region] CR ON CR.Code = SIH.[Country of Final Destination]
INNER JOIN [Customer] C ON C.No_ = SIH.[Sell-to Customer No_] WHERE SIH.No_ = 'PEXP1213-540'
No need to replace direct use 106 or 105 and get the desired format
SELECT convert(varchar, getdate(), 106)– dd mon yyyyso ur query look like
Also can do on codeBehind: