问题1、程序中如何指定每个月份的1号,比如我选择的是6月,然后dbgrideh1里面的日期字段就显示2004-6-1?我的意思是,在一个下拉菜单里选择6月份,那么dbgrid里面的某一列(其字段类型为日期)就显示为2004-6-1(默认时间可能是2004-6-10或者2004-6-22),反正保证第一行是6月份而且是1号?这如何实现呢?问题2、如果我第一行的日期是2004-6-1,那么第二行日期默认显示为2004-6-1,如果我将第二行日期改为2004-6-10则第三行日期默认为2004-6-10?
解决方案 »
- 关于ODAC的中SQL 中文
- 类似于.udl文件,delphi 如何列出某一个服务器 上的所有数据库?
- 急!! 高分求助! 一个MDI问题
- 哥哥帮忙解决一下,急!谢谢
- 在线等待各位老大帮忙。。。。。。
- 一道难题,能解决的朋友赠送100分!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 请问 在哪儿有 delphi 7.0 中文版的帮助????? 十万火急
- 软件拿到国外为什么不能用?
- 今天结贴,分数只给一个人!如何列出一个指定的文件夹下的所有子文件夹名。
- 如何修改installshield制作的安装软件上的标题栏!!!
- 一个“事件调用”的问题----------在线等待!!!
- 如何将一个Combobox组件里面的所有的内容来填充另外一个Combobox
var y,m,d:Word;
DecodeDate(DateTimePicker1.Date, y,m,d);
Query['field'] := EncodeDate(y,m,1);2 你需要自己记录最后一行的日期值。
2.事件写代码Returns a TDateTime value that represents a specified Year, Month, and Day.UnitSysutilsCategorydate/time routinesfunction EncodeDate(Year, Month, Day: Word): TDateTime;DescriptionEncodeDate returns a TDateTime value from the values specified as the Year, Month, and Day parameters.The year must be between 1 and 9999.Valid Month values are 1 through 12.Valid Day values are 1 through 28, 29, 30, or 31, depending on the Month value. For example, the possible Day values for month 2 (February) are 1 through 28 or 1 through 29, depending on whether or not the Year value specifies a leap year.If the specified values are not within range, EncodeDate raises an EConvertError exception.