Covert to SQL Server Format

2 posts, 0 answers
  1. Tony Casey
    Tony Casey avatar
    9 posts
    Member since:
    Jan 2010

    Posted 05 Apr 2010 Link to this post

    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.
  2. Tony Casey
    Tony Casey avatar
    9 posts
    Member since:
    Jan 2010

    Posted 07 Apr 2010 Link to this post

    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'";  
     
Back to Top