If you are working with Oracle and C#, you may need to insert a Date into the database. The way this is done, is to specifiy a date format and then let Oracle know what the format is by using the "to_date" function. One of the problems is that C# and Oracle specifiy date formats differently.
Here is one example:
strFromDate = myFromDate.ToString("MM/dd/yyyy hh:mm:ss tt");
strToDate = myToDate.ToString("MM/dd/yyyy hh:mm:ss tt");
_sqlQuery += "AND DATE_COMPLETED >= to_date('" + strFromDate + "', 'MM/DD/YYYY HH:MI:SS PM') ";
_sqlQuery += "AND DATE_COMPLETED <= to_date('" + strToDate + "', 'MM/DD/YYYY HH:MI:SS PM') ";
Friday, October 12, 2007
Subscribe to:
Post Comments (Atom)
Check This Out!
More Links to Good Information
- December (1)
- October (1)
- January (1)
- September (1)
- February (2)
- January (2)
- May (3)
- February (1)
- May (1)
- October (1)
- January (1)
- August (1)
- March (1)
- May (1)
- March (1)
- January (1)
- March (1)
- December (2)
- September (2)
- June (1)
- February (1)
- January (1)
- October (1)
- December (2)
- November (1)
- August (4)
- July (14)
- June (10)
- May (9)
- April (2)
- February (4)
- January (2)
- December (7)
- October (10)
No comments:
Post a Comment