strtodate();
if date1=date2 then.....

解决方案 »

  1.   

    Query1.FieldByName('生日').AsDateTime
      

  2.   

    如果数据库中的生日字段值为1777-12-23
    那么可以这样做:
    var sStr: String;
      
      sStr := FormatDateTime('-MM-DD',Date);
      with Query do
      begin
        Close;
        Sql.Text := 'SELECT * FROM TableName WHERE Birth LIKE ''%'+sStr+'''';
        Open;
      end;
      

  3.   

    Mybirthday=Query1.FileldByName('column').AsString;
    if mybirthday=DateToStr(today()) then
      //今天是你的生日我的------分呀!
      

  4.   

    var 
        aaa,bbb: String;
    begin
        aaa := FormatDateTime('MM',Date);
        bbb := FormatDateTime('DD',Date);
        with Query1 do
             begin
                 Close;
                 Sql.Clear;
                 Sql.Add('SELECT * FROM TableName WHERE Month(Birth) = ' +  aaa + ' AND  Day(Birth) = ' + bbb);
                Open;
            end;end;
      

  5.   

    首先在系统启动的时候就FormatDateTime('YYYY-MM-DD',Date);
      然后TodayStr=RightStr(DateToStr(today()), 5);
    然后MybirthdayStr=RightStr(Mybirthday,5);
    if TodayStr=MybirthdayStr then
    ……
      

  6.   

    var ADate:TDatetime;
    Year,Month1,Day1,Month2,Day2:Word;
    begin
    ADate := StrToDate(Query1.fieldbyname('生日').AsString);
    DecodeDate(ADate, Year, Month1, Day1);
    DecodeDate(Now,Year,Month2,Day2);
    if (Month1=Month2) and (Day1=Day2) then
    ......
      

  7.   

    var 
        aaa,bbb: String;
    begin
        aaa := FormatDateTime('MM',Date);
        bbb := FormatDateTime('DD',Date);
        with Query1 do
             begin
                 Close;
                 Sql.Clear;
                 Sql.Add('SELECT * FROM TableName WHERE Month(Birth) = ' +  aaa + ' AND  Day(Birth) = ' + bbb);
                Open;
            end;end;
      

  8.   

    if strtodate(生日)=date() then
    begin
      ............
    end;
      

  9.   

    我的天,fable(老四)你是要分狂呀!!!!!!
    if mybirthday=DateToStr(today()) then
      
    today这编译不通过
    票票:你的程序也没通过,好象是数据库的错
      

  10.   

    var
       birth:TDatetime;
       Year,Month1,Day1,Month2,Day2:Word;
    begin  birth:= Query1.fieldbyname('生日').AsDateTime;
      DecodeDate(birth, Year, Month1, Day1);
      DecodeDate(Now,Year,Month2,Day2);
      if (Month1=Month2) and (Day1=Day2) then  done!!!
      

  11.   

    老四,你的datetostr(today())不对,说不认识today
      

  12.   

    if strtodate(生日)=date() then
    begin
      ............
    end;
      

  13.   

    将你的生日从数据表中取出来,然后用copy函数取出你的月日。
    将系统时间取出来用formatdatatime 转换为你需要的月日字符串。
    将这两个值进行比较。
      

  14.   

    make11111(可可) 
    sorry,从delphi向pb转行了(有时还要用vfp),有些函数搞混了!