SQL Server中往后加一个月,往前的用负数
DateAdd(month,1,GetDate())

解决方案 »

  1.   

    Returns a date shifted by a specified number of months.UnitSysutilsCategorydate/time routinesfunction IncMonth(const Date: TDateTime; NumberOfMonths: Integer): TDateTime;DescriptionIncMonth returns the value of the Date parameter, incremented by NumberOfMonths months.  NumberOfMonths can be negative, to return a date N months previous.If the input day of month is greater than the last day of the resulting month, the day is set to the last day of the resulting month.  The time of day specified by the Date parameter is copied to the result.
      

  2.   

    我用的都是笨法子
    decodedate(date,year,month,day);//提取当前时间
    然后再把年月日分开来用!month:=month+1;
      

  3.   

    genphone_ru(票票)说的是对的啊!
      

  4.   

    我只懂C++Builder,不知Delphi中有没有这样的函数:TDateTime vDate=Date(); //变量vDate的值为当前日期
    vDate=IncMonth(vDate,5); //加5个月,可以为负数ShowMessage(vDate.FormatString("yyyy'年'mm'月'dd'日'"); //显示出来