如何取得本月和下个月的最后一天,并且把下个月的记录全部显示出来

解决方案 »

  1.   

    本月的最后一天:dateserial(year(date),month(date)+1,0)
    下月的最后一天:dateserial(year(date),month(date)+2,0)
      

  2.   

    '-----------------------------------------------------
    '得到每个月的天数
    '-----------------------------------------------------
    Public Function GetDays(ByVal DTM As Date) As Long
        Dim lYear As Long, lMonth As Long
        lYear = Year(DTM)
        lMonth = Month(DTM)
        
        Select Case lMonth
            Case 1, 3, 5, 7, 8, 10, 12
                GetDays = 31
            Case 2
                If (lYear Mod 4) = 0 Then
                    GetDays = 29
                Else
                    GetDays = 28
                End If
            Case 4, 6, 9, 11
                GetDays = 30
        End SelectDim Days As LongDays = g_Sys.GetDays(你的日期)Format(你的日期,"yyyyMM00") + 1 '开始日期
    Format(你的日期,"yyyyMM00") + Days '结束日期
    Sql语句中 Between 开始日期 And 结束日期
      

  3.   

    Sql语句中 Between 开始日期 And 结束日期
    具体怎么写,
      

  4.   

    SQL = "Select * From 你的表名 Where (你的日期字段名 BetWeen #" & 你的开始日期 & "# And #" & 你的结束日期 & "#)"
      

  5.   

    那用dateadd函数怎么得到下个月的最后一天
      

  6.   

    如果要播入这此日期是不是这样:
    insert into 表名(字段名)value(BetWeen #" & 开始日期 & "# And #" & 结束日期 & "#)"
      

  7.   

    本月的最后一天:dateserial(year(date),month(date)+1,0)
    下月的最后一天:dateserial(year(date),month(date)+2,0)
    象狼行天下所说的方便
      

  8.   

    dateadd("m",1,date())-datepart("d",dateadd("m",1,date()))