【在线求助】DataTable.Select()的用法????????

自由_ 2010-07-12 01:29:32
怎么在datatable.selec()中,把系统时间赋值进去,让它与表中的一个时间类型的时段相减
数据库中:select * from a where sysdate-date<=7
用的数据库是Oracle
...全文
196 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
风平心境 2010-07-12
  • 打赏
  • 举报
回复
不如你直接写select语句的时候就把 sysdate-date 写进去做一列
select ... sysdate-date as timespan from tablename
myhope88 2010-07-12
  • 打赏
  • 举报
回复
具体功能得说清楚,不然不知道啥意思
LovingAlison 2010-07-12
  • 打赏
  • 举报
回复

DataTable t = new DataTable();

t.Columns.Add("No", typeof(int));
t.Columns.Add("Name", typeof(string));

t.Rows.Add(1,"Kevin");
t.Rows.Add(2, "Alison");
t.Rows.Add(3, "Sophie");
t.Rows.Add(4, "Vicky");
t.Rows.Add(5, "Cherry");

DataRow[] rows = t.Select("No>=3");
小黑哥gs 2010-07-12
  • 打赏
  • 举报
回复
你实在不行就把该字段取出来。。在程序里面操作。。然后在进行select
q107770540 2010-07-12
  • 打赏
  • 举报
回复
select * from a where datediff(day,getdate(),sysdate)<7

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧