Tech Junkie Blog - Real World Tutorials, Happy Coding!: Oracle Date Format And Compare

Wednesday, September 4, 2013

Oracle Date Format And Compare

Oracle dates have a different format than SQL Server dates. So to select a date for the Oracle database you have to have the date in the following format.
string myDate = "10/9/2012 2:55:25 PM";

  string sql = "SELET * FROM SomeTable WHERE SomeDateField=" +
       "to_date('" + myDate + "','" + "MM/DD/YYYY HH:MI:SS " + 
       myDate.Substring(myDate.Length - 2) + "');";

Next: C# Querying From An Oracle Database

2 comments:

  1. At Casino Niagara Noon – 4:00am daily ... or visit the Momentum Desk or VIP Services Desk at.

    ReplyDelete
  2. Oracle dates have a different format than SQL Server dates. 1depositcasinouk So to select a date for the Oracle database you have to have the date in the following format.

    ReplyDelete

Search This Blog