john john - 5 months ago 11
SQL Question

How to remove time from date in JavaScript pulling record from SQL

@Html.Raw(Helper.FormatData("Sale Date: ",
headerData.Tables[0].Rows[0]["Sale_Date"].ToString().Trim(),
null, true))


This is the code that pulls record from SQL. The data was updated and the Sale_ Date column data type was changed.
now I get the result as
02/01/1999 12.00.00 AM
I would like it to display as
02/01/1999
.

Is there any JavaScript code that convert this code?

Kld Kld
Answer
    @Html.Raw(Helper.FormatData("Sale Date: ",((DateTime)headerData.Tables[0].Rows[0]["Sale_Date"]).ToString("d"),
 null, true))