I am having issues when comparing dates and date/time values in an Oracle 9i database. I am using LLBLGen version 1.0.2005.1.
Here is a sample C# code snippet:
whereExpression.Add(PredicateFactory.CompareValue(AdvMtgHistFieldIndex.MtgDteTim, ComparisonOperator.GreaterEqual, startDate, "History"));
startDate is of type System.DateTime.
With this line of code present, no rows are returned. Without this date comparison code, rows ARE returned. Two of the rows have values in this DATE column of "2006-09-15 13:00:00" and "2006-09-15 12:00:00".
When I turn on tracing using the following system.diagnostics tags in web.config...
<system.diagnostics>
<switches>
<add name="OracleDQE" value="4" />
<add name="SqlServerDQE" value="4" />
</switches>
</system.diagnostics>
...the SQL generated related to this portion of the WHERE clause looks like this:
"ADV_MTG_HIST"."MTG_DTE_TIM" >= :MtgDteTim1
and the parameter looks like this:
Parameter: :MtgDteTim1 : Date. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 9/15/2006 12:00:00 AM.
Does anyone know if this is the actual SQL sent to Oracle? This will not work when used in SQLPlus or other Oracle client tools I have used.
By the way, the product I maintain runs against both MS SQL Server and Oracle (thanks to the new typeconverter feature
!). Unfortunately date comparisons only seem to work against MS SQL Server. Anyone know if I am doing anything wrong?
Thanks in advance!