如同生日提醒一样的!
最好是能在Sql语句中实现!!
谢谢!
最好是能在Sql语句中实现!!
谢谢!
解决方案 »
- delphi中label
- 任务管理控件怎么根据ID选择获得TcxSchedulerControlEvent对象
- 程序按钮小图标如何只剪有图的部分,空白的通通去掉
- DBCHART MouseMove 取X轴日期类型数值问题
- ExportGrid4ToEXCEL导出execl怎么最多只能48行?
- form 中的 可编辑的属性 是:properties?
- 请问怎么样清空一个文件夹里面的文件啊?
- 本人紧急收购卡拉OK VOB片源文件,有人提供的请留言联系了
- 如何发布用ADO控件连接的数据库程序?
- 怎样将分组后的数据另存到一个表中?
- 多线程中,如何在主线程和其他线程中公用StringList,这个stringList如何传入到其他子线程中?多谢!!
- idftp问题请教?
--------
Function TFrmMain.DateTest(Birthday:TDateTime):INTEGER;
var
dayinc:integer;
Present: TDateTime;
Yearnow, Monthnow, Daynow,DayBir: Word;
begin
Present:=Now;
DecodeDate(Present, Yearnow, Monthnow, Daynow);
DecodeDate(Birthday,yearnow,monthnow,daybir);
IF monthstr(Birthday)<>MonthStr(date) then
result:=100
Else
begin
{ showmessage(inttostr(daybir));
showmessage(datetimetostr(Birthday));}
dayinc:=daybir-daynow;
if (dayinc<-1) or (dayinc>1) then
result:=100
Else
result:=dayinc;
end; end;Procedure TFrmMain.BirthdayTest();
var
Bir:tdatetime;
name:String;
daynum:integer;
Begin
With QrySel do
begin
close;
sql.clear;
sql.Add('select birthday,name from tongxu where birthday is not null order by birthday');
open;
end;
if QrySel.RecordCount<1 then exit;
QrySel.First;
While not QrySel.Eof do
Begin
Bir:=StrtoDateTime(QrySel.Fieldbyname('birthday').asstring);
name:=QrySel.FieldByName('name').asstring;
QrySel.Next;
daynum:=DateTest(Bir);
if daynum=100 then
continue
Else
Begin
case daynum of
1:showMessage('嗯,明天可是'+name+'的生日了');
0:showMessage('嗯,今天可是'+name+'生日,看着办吧');
Else
End;
End; End;End;
where right(convert(varchar(10),Birthday,121),5) between '01-01' and '12-31'
比如提前7天通知怎么办!
Kshape([伟大的大伟!]) 你的我在看!!
明天去公司验证了放分!
我原来写的select * from tb
where dateadd(year,datediff(year,birthday,getdate()),birthday) between getdate() and getdate()+7
From SubStr(CONVERT(VarChar(11),Field1), 5, 5)=SubStr(CONVERT(VarChar(11),Field2), 5, 5)
where right(convert(varchar(10),Birthday,121),5)
between right(convert(varchar(10),GetDate(),121),5) and
right(convert(varchar(10),GetDate() + 7,121),5)