使用日期发生了问题 [英] Problem occured using date

查看:104
本文介绍了使用日期发生了问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从两个日期之间获取报告

所以我给出以下两个日期之间的获取日期的编码

I want to get the report from between two dates

So i give the following coding for get date between two dates

Select sum(Paid) from Pending where 
Paydate >=''" Format(fromdate.Value, "MM/dd/yyyy") & "'' and
 Paydate <=''" & Format(todate.Value, "MM/dd/yyyy")



是显示正确答案

但是我给出的fromdate是2011年12月,today是今天,付款金额不显示

但是我给出了之间的日期,正确的答案将会显示

如何解决,请帮帮我

谢谢您.



It is display correct answer

But the i give the fromdate is Dec 2011 and todate is today the paid amount is not display

But i give the dates between from this the correct answers will displays

how to solve it please help me

Thank you

推荐答案

选项之一是截断时间&比较:

one of the option is to truncate time & compare:

Select sum(Paid) from Pending where
CONVERT(varchar(10), Paydate,101)  >='" Format(fromdate.Value, "MM/dd/yyyy") & "' and
 CONVERT(varchar(10), Paydate,101) <='" & Format(todate.Value, "MM/dd/yyyy")


这篇关于使用日期发生了问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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