文本框值大于>然后执行quary(文本框值减去两个日期) [英] Textbox value is greater than>1 then execute quary (textbox value is subtraction of two date)

查看:61
本文介绍了文本框值大于>然后执行quary(文本框值减去两个日期)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

textbox1值来自数据库中的数据库和textbox2值,并减去textbox1-textbox2和textbox3上的vale打印如何检查数据库中的所有id,其中我获得的值大于1,并显示来自数据库的id数据



我尝试了什么:



i尝试循环他们但我不能定义它

textbox1 value come from data base and textbox2 value from data base and subtract textbox1-textbox2 and vale print on textbox3 how it check all id from data base where i get value greater than 1 it execute and show that id data from data base

What I have tried:

i try looping their but i cant define it

推荐答案

如果Textbox1和Textbox2的值都来自数据库,你只需要在Textbox3中显示这两个值的减法,那么你可以构建查询类似于以下内容

If both the values for Textbox1 and Textbox2 are coming from the database and you just need to show the substraction of these two values in Textbox3 then you can build the query something like following
SELECT Value1, Value2, (Value1-Value2) AS Value3
FROM YourTable



如果您需要如你在问题中提到的那样应用任何过滤器,你可以做类似的事情 -


and if you need to apply any filter as you have mentioned in the question, you can do something like-

SELECT Value1, Value2, CASE WHEN (Value1-Value2)>1 THEN (Value1-Value2) ELSE NULL END AS Value3
FROM YourTable





如果您的要求是其他的,那么请告诉我一些关于您的要求的描述。



:)



If your requirement is something else then this, please let me know with some words of description about your requirement.

:)


这篇关于文本框值大于>然后执行quary(文本框值减去两个日期)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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