本文介绍了查询搜索数据“从日期到日期"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将ms-access用作数据库后端,并将Visual Studio 08用作Windows应用程序中的前端.

对于现金表,我有Date列,其数据类型为字符串,以便可以以自定义格式存储数据,例如"12 -Jan -2011".

此值来自dateTimePicker.Text属性.
我使用了dateTimePicker的自定义属性.

对于插入,更新和删除来说,它工作正常,但是当我运行查询以查找数据之间的日期"时,它没有给出正确的结果.

用最少的修改就能解决此问题的最佳选择是什么?
:confused :: confused:

问候,
*已删除邮件*

I am using ms-access as database backend, and visual studio 08 for frontend in windows application.

For a cashbook table, I have Date column whose data type is string so that I can store data in my custom format like ''12 -Jan -2011'' .

This value is coming from dateTimePicker.Text property.
I have used custom property of dateTimePicker.

It is working fine for insert, update and delete, but when I am running query to find data ''date between'', it is not giving proper result.

what can be best option to resolve this problem with least modification ?
:confused::confused:

Regards,
*REMOVED MAIL*

推荐答案

SELECT Date FROM CashBook WHERE cast(Date as datetime) BETWEEN ''...a from date here'' AND ''...a to date here''



Andy



Andy



这篇关于查询搜索数据“从日期到日期"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 06:18