将C#中的DateTime.MinValue替换为sql

时间:2013-06-06 06:58:59

标签: c# oracle

在C#中,我使用了linq,其中我使用了最小值的DateTime。 我将在oracle中转换此查询。

select x 
from x in Context.GetRolePlansQuery(AppResources.CurrentUser.Role.RoleId,
                                                                   AppResources.CurrentUser.Loginid,
                                                                   AppResources.CurrentUser.Tpa.TpaId) where
x.LAST_STAGE_COMPLETE.ToUpper() == "RECEIVED"
orderby (x.CDC_COMPLETE_DATE.HasValue ? x.CDC_COMPLETE_DATE : DateTime.MinValue) descending
select x 

我想知道oracle中Min值的服务器日期时间。

1 个答案:

答案 0 :(得分:1)

这应该让您对oracle sql server数据类型的值范围有一个公平的理解: http://docs.oracle.com/cd/B28359_01/server.111/b28286/sql_elements001.htm#i54330

但是,.net对象和sql server数据类型的最小值存在差异,DateTime.MinValue的最小值为0001/1/1。