This is a migrated thread and some comments may be shown as answers.

Covert to SQL Server Format

1 Answer 54 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Tony Casey
Top achievements
Rank 1
Tony Casey asked on 06 Apr 2010, 12:08 AM
Hi Guys,

I have searched through the forum and cannot find how to convert the date into an SQL format string.

When the date is submitted it is in the "dd-mm-yyyy hh-mm-ss" format, trouble is, SQL Server stores its dates in "yyyy-mm-dd hh-mm-ss" format.

Is there a way of converting the date to SQL server date, I dont want the display date to look like the SQL date.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Tony Casey
Top achievements
Rank 1
answered on 07 Apr 2010, 10:38 PM
Had to do it manually...


if (!RadDatePickerJobTo.SelectedDate.ToString().Equals(String.Empty))  
{  
 
                sql += " AND Job_CreatedDate <= '" + RadDatePickerJobTo.SelectedDate.Value.Year + "-" + RadDatePickerJobTo.SelectedDate.Value.Month + "-" + RadDatePickerJobTo.SelectedDate.Value.Day + " 23:59:00.000'";  
 
Tags
Calendar
Asked by
Tony Casey
Top achievements
Rank 1
Answers by
Tony Casey
Top achievements
Rank 1
Share this question
or