如何计算日期差异和数字差异(How to Calculate Date Diff And Num Diff)

   IT问题网   2021-02-20 00:00:00

问 题

glno transcationdate存款取款transid loannum



1003 08/06/2010 12:00:00 am null 22500.0000 17088 694

1003 21/08/2010 12:00:00 am null 618.0000 18436 694

1003 31/03/2011 12:00:00 am 1303.0000 null 19479 694



以上示例实际上我的表数据



但我需要





glno transcationdate存款取款noofdays balance loannum



1003 08/06/2010 12:00:00 am 1303 22500.0000 296 21822 694

1003 21/08/2010 12:00:00 am 618 null 222 618 694



描述:



第一个withdrawal金额比第一个首次存款金额更大,然后是第一个withdral transactiondate减去( - )首次存款交易日期,在这些交易之间天数计算为无天数



首次提取金额 - (减)首次存款金额为余额。

如果是第二次存款金额在表中

然后余额 - 第二存款金额和noofdays计算相同



如果你已经理解我的问题plz解决并且很快发送回复这对我来说非常重要







感谢您以前的回复

非常感谢你满意......



如果你可能发送回复非常紧急



plz发送回复我需要非常紧急本报告

plz帮助我任何一个

解决方案

试试这个一个



  select  *  from  tablename 
where transid in selec t min(transid) from tablename where loannum = 694

这不是与此完全相同的问题:如何删除sql中的第一行 [ ^ ]



transid现在是主键吗?如果是,那么你冷酷的使用:

  delete   from  tablename 
where transid = 17043 ;


但在实际情况下使用 sqlparameter[ ^ ]



如果transid不是主键,那么如上一个答案中所述,一种可能性是指定delete语句中的所有列。所以类似于:

  delete   from  tablename 
where glno = 1003
and transcationdate = ' 07/06/2010'
and 存款= 24300
and 提取 is null
and transid = 17043
and loannum = 694


在此示例中,您必须检查是否只删除了1行(如果transid不是主键,则再次)。

标签:如何计算日期差异悬殊以及数字



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

ie6浏览器问题在我的网页上(ie6 browser issue in my web page)

problem my webpage displaying 1 inleft bottom corner only ...

无法在表单上使用控件。(Unable to use controls on the form.)

problem hi, i have created some static insta ...

如何在Javascript中使用正则表达式匹配定义的模式(How to match defined pattern using regular expression in Javascript)

problem hi, first, there is a string called: var bookpat ...

我想打印收据,但我遇到了问题(I want to print a reciept but i face a problem)

problem in this project i am using datareport ...

Visual Studio 2010 + Windows 7 + 64位计算机+ C ++ + 32位DLLS = 3个问题(Visual Studio 2010 + Windows 7 + 64-bit computer + C++ + 32 bit DLLS = 3 problems)

problem i''ve been using visual studio 2005 for many year ...

什么是Eclipse以及如何使用它?(What is about Eclipse and how to use it)

problem how to use it .and for what purpose it is used so ...

如何从数据库中检索数据?(how to retrieve data from database)

problem i have a radiobuttonlist control and i want to re ...

使用SQL Management Studio将数据插入我的数据库时执行NonQuery(ExecuteNonQuery while inserting the data into my database using SQL Management Studio)

problem hi i have a problem while inserting the data int ...

我如何将C#.Net中的拖放图像转换为ASP.Net(how do i convert Drag and drop image in C#.Net to ASP.Net)

problem hi, i saw the drag and drop image in c#.net arti ...

如何禁用浏览器的后退按钮(How to disable browser's back button)

problem hello friend, i am using asp.net framework 3.5,i ...

滚动后无法打印文本....(Unable to print text after scrolling....)

problem hi, i have written a small c program ...

我使用radgrid,我从数据库获取列名,但我希望他们的名称作为不同的名称,如何重命名RadGrid的列名(Im using a radgrid ,i get column names from database but i want their names as diferent names,How to rename those columns names of RadGrid)

problem im using a radgrid ,i get column names from datab ...

用于showbits函数的头文件(header file to be used for showbits function)

problem which header file shd be used for showbits() func ...

在gridview控件中删除事件行。(Row Deleting event in gridview control.)

problem i am trying to delete userid and groupid from the ...

如何查看.dll文件中编写的代码?(how to view code written in .dll file)

problem hi to all.i have downloaded source co ...

登录 - 使用哈希值检查密码(login - check password with hashed one)

problem this is my code to hash class hashin ...

上传图片时出现问题(problem in uploading images)

problem i want to upload images that will be saved in a f ...

如何使用c#向Bixolon热敏打印机发送命令(How to Send commands to Bixolon thermal printer using c#)

problem first of all , i have searched on goo ...

图像波动问题(image fluctuation problem)

problem i want to know how to remove image fluctuate from ...

LISTVIEW每行的随机ID(LISTVIEW random id for each row)

problem hi, all i want is to generate an id ...