时段雨量 每隔一小时整点报的雨量 这个雨量是前一个时间段下的雨量
日雨量 每日八点报的雨量 这个雨量值是昨日早八点到今日早八点下的总雨量
昨日早八点到今日早八点我们称作一个雨量日
现用户输入两个时间字符串例如:2010-8-1 2:00:00 到 2010-8-5 10:00:00
要查出这段时间雨量 2010-8-1 2:00:00 到 2010-8-1 8:00:00 这段时间累加时段雨量 得到 a
2010-8-1 8:00:00 到 2010-8-5 8:00:00 累加日雨量 得到b
2010-8-5 8:00:00 到 2010-8-5 10:00:00 到 2010-8-1 8:00:00 这段时间累加时段雨量 得到 ca+b+c 得到这段时间的雨量 也就是说 不足一个雨量日的累加时段雨量 满足一个雨量日的累加日雨量用户输入的时间段会多种多样 要考虑所有情况
各位帮帮忙
日雨量 每日八点报的雨量 这个雨量值是昨日早八点到今日早八点下的总雨量
昨日早八点到今日早八点我们称作一个雨量日
现用户输入两个时间字符串例如:2010-8-1 2:00:00 到 2010-8-5 10:00:00
要查出这段时间雨量 2010-8-1 2:00:00 到 2010-8-1 8:00:00 这段时间累加时段雨量 得到 a
2010-8-1 8:00:00 到 2010-8-5 8:00:00 累加日雨量 得到b
2010-8-5 8:00:00 到 2010-8-5 10:00:00 到 2010-8-1 8:00:00 这段时间累加时段雨量 得到 ca+b+c 得到这段时间的雨量 也就是说 不足一个雨量日的累加时段雨量 满足一个雨量日的累加日雨量用户输入的时间段会多种多样 要考虑所有情况
各位帮帮忙
解决方案 »
- 累计概率函数的问题
- 读取XML文件的TreeView如何将子节点下详细内容逐个显示到label标签中
- 我文本框里有'号,我怎么这个文本框里有没有这个单引号.在线求解
- 如何用程序控制鼠标的移动,单击、双击、拖曳
- 关于Timer控件 谢谢
- 24点算法
- 注册的过程中接收汉字 怎么成了乱码?
- 请问:应用程序打包的时候,怎么把BIN\DEBUG\*.EXT和*.dll分开放到另一个DLL目录中?谢谢!!!!急!急!急!
- 如何将一个dataset到出为.dbf文件?
- 如何用C#代码打开指定的QQ群???坐等大神们进来展示身手。。
- 高分求用C#生成treeView的疑难问题
- windows服务间隔性启动失败
这意思是不是说 这些雨量反正就是全部累加起来晕 楼主这些数据从哪里获得?楼上说的web service
/// <summary>
/// 返回查询语句
/// </summary>
/// <param name="SM">开始月</param>
/// <param name="SD">开始日</param>
/// <param name="SH">开始时</param>
/// <param name="EM">结束月</param>
/// <param name="ED">结束日</param>
/// <param name="EH">开始时</param>
/// <returns>查询语句</returns>
private string [] timeSql(string SY,string SM,string SD,string SH,string EY,string EM,string ED,string EH)
{
string ST=SY+"-"+SM+"-"+SD+" "+SH+":00:00";
string ET=EY+"-"+EM+"-"+ED+" "+EH+":00:00";
int sh = Convert.ToInt32(SH);
int eh = Convert.ToInt32(EH);
DateTime ST8 = new DateTime ();
DateTime ET8 = new DateTime (); string[] strSql=new string[3]; switch (sh)
{
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
ST8 = Convert.ToDateTime(SY+"-"+SM+"-"+SD).AddDays(1).AddHours(8);
strSql[0] = "SELECT REPLACE(b.STNM, ' ', '') AS z_name,isnull(sum( r.DrP),0) AS ral into #q FROM ST_PPTN_R r , ST_STBPRP_B b where b.stcd= r.stcd and r.tm >'"+SY+"-"+SM+"-"+SD+" "+SH+":00:00' and tm<='"+Convert.ToDateTime(SY+"-"+SM+"-"+SD).AddDays(1).AddHours(8)+"' group BY b.stnm";
break;
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
ST8 = Convert.ToDateTime(SY+"-"+SM+"-"+SD).AddHours(8);
strSql[0] = "SELECT REPLACE(b.STNM, ' ', '') AS z_name,isnull(sum( r.DrP),0) AS ral into #q FROM ST_PPTN_R r , ST_STBPRP_B b where b.stcd= r.stcd and r.tm >'"+SY+"-"+SM+"-"+SD+" "+SH+":00:00' and tm<='"+SY+"-"+SM+"-"+SD+" 8:00:00' group BY b.stnm";
break;
} switch (eh)
{
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
ET8 = Convert.ToDateTime(EY+"-"+EM+"-"+ED).AddHours(8);
strSql[2] = "SELECT REPLACE(b.STNM, ' ', '') AS z_name,isnull(sum( r.DrP),0) AS ral into #p FROM ST_PPTN_R r , ST_STBPRP_B b where b.stcd= r.stcd and r.tm >'"+EY+"-"+EM+"-"+ED+" "+"8:00:00' and tm<='"+EY+"-"+EM+"-"+ED+" "+EH+":00:00' group BY b.stnm";
break;
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
ET8 = Convert.ToDateTime(EY+"-"+EM+"-"+ED).AddDays(-1).AddHours(8);
strSql[2] = "SELECT REPLACE(b.STNM, ' ', '') AS z_name,isnull(sum( r.DrP),0) AS ral into #p FROM ST_PPTN_R r , ST_STBPRP_B b where b.stcd= r.stcd and r.tm >'"+Convert.ToDateTime(EY+"-"+EM+"-"+ED).AddDays(-1).AddHours(8)+"' and tm<='"+EY+"-"+EM+"-"+ED+" "+EH+":00:00' group BY b.stnm";
break;
}
strSql[1] = "SELECT REPLACE(b.STNM, ' ', '') AS z_name,isnull(sum( r.DYP),0) AS ral into #t FROM ST_PPTN_R r , ST_STBPRP_B b where b.stcd= r.stcd and r.tm >'"+ST8+"' and tm<='"+ET8+"' group BY b.stnm";
return strSql;
}谁还有更好的方法