@begindate='2002-3-4'
select * from table where FromDate>=@begindate and Todate<=dateadd(dd,@begindate,25)
select * from table where FromDate>=@begindate and Todate<=dateadd(dd,@begindate,25)
解决方案 »
- rs.RecordCount返回值-1问题,大虾请赐教,在线等待!!!
- 窗体透明
- 两个不同内网之间的通信
- 这俩句代码,算出来的东西有什么用处,意义做何解释?高手指点
- 为什么写好的程序拿到别的机器上总是出现这个ocx未注册那个ocx版本不兼容的问题/提示,即便制作了安装包也是一样.有好的解决方案吗?
- 在VB中,如何获得本机CPU的序列号?
- 如何实现在点击窗口的关闭按钮时,使窗口最小化,而不退出程序?
- 请教高手:如何在VB中实现程序的自我更新
- VB IDE 设计时的十字鼠标颜色异常
- 请教!!我现在用VB+SQL编一个模块,数据的增加.....
- ADO问题!!!
- 哪位兄弟用过wise install ,快来救命!
'放在module中
Type DateInternal
frmDate As Date
toDate As Date
End Type
'放在form中
Private Sub Form_Load()
Dim Frdate As Date
Dim toDate As Date
Dim theDay As Integer
Dim MyDate() As DateInternal
ReDim MyDate(0)
Frdate = #12/4/2002#
toDate = #5/16/2004#
theDay = Day(Frdate)
If theDay > 25 Then
Exit Sub
End If
While Frdate < toDate
MyDate(UBound(MyDate)).frmDate = Frdate
If Day(Frdate) <= 25 Then
MyDate(UBound(MyDate)).toDate = Frdate + (25 - Day(Frdate))
Else
MyDate(UBound(MyDate)).toDate = DateAdd("m", 1, Frdate + (25 - Day(Frdate)))
End If
If MyDate(UBound(MyDate)).toDate >= toDate Then
MyDate(UBound(MyDate)).toDate = toDate
End If
Frdate = MyDate(UBound(MyDate)).toDate + 1
ReDim Preserve MyDate(UBound(MyDate) + 1)
Wend
For i = 0 To UBound(MyDate) - 1
Text1.Text = Text1.Text & MyDate(i).frmDate & " " & MyDate(i).toDate & vbCrLf
Next
End Sub