如何使用sql server查询找到可用的下一批日期 [英] how to find the next batch date available using sql server query

查看:61
本文介绍了如何使用sql server查询找到可用的下一批日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如下

Minor_Code     Startdate

 PSCRB        11/05/2013
 R-AFF        12/05/2013
 PSCRB        14/05/2013
 R-AFF        15/05/2013
 PSCRB        17/05/2013
 R-AFF        18/05/2013
 PSCRB        20/05/2013
 R-AFF        21/05/2013
 PSCRB        27/05/2013
 R-AFF        28/05/2013



在设计中如下


In design as follows

PSCRB   Dropdownlist(From database Startdate are retrieved)
R-AFF   Dropdownlist(From database Startdate are retrieved)




          11/05/2013
          14/05/2013
PSCRB     17/05/2013
          20/05/2013
          27/05/2013

          12/05/2013
          15/05/2013
R-AFF     18/05/2013
          21/05/2013
          28/05/2013



用户必须选择的正确方式是RPSCRB日期11/05/2013(来自下拉列表)和R-AFF日期12/05/20 13(来自下拉列表)



假设用户选择RPSCRB日期11/05/2013(来自下拉列表)和R-AFF日期15/05/2013(来自dropdownlist)使用sql server查询从数据库中检查的时间,检查下一个可用的批处理日期。



为什么我可以使用sql server检查下一个可用的批处理日期来自数据库。



rgds,

narasiman P.


Correct way user has to select is RPSCRB date 11/05/2013(from the dropdownlist) and R-AFF date 12/05/2013(from the dropdownlist)

suppose if user select RPSCRB date 11/05/2013(from the dropdownlist) and R-AFF date 15/05/2013(from the dropdownlist) that time check from the database using sql server query,check the next available batch date.

for that how can i check next available batch date using sql server from the database.

rgds,
narasiman P.

推荐答案

从TableName中选择Startdate,其中Minor_Code ='R-AFF'和Startdate> '15 / 05/2013'
Select Startdate From TableName where Minor_Code='R-AFF' and Startdate>'15/05/2013'


这篇关于如何使用sql server查询找到可用的下一批日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆