- ©«¤l
- 519
- ¥DÃD
- 54
- ºëµØ
- 0
- ¿n¤À
- 595
- ÂI¦W
- 251
- §@·~¨t²Î
- win 10
- ³nÅ骩¥»
- []
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2013-3-19
- ³Ì«áµn¿ý
- 2024-11-18
|
¦^´_ 1# t8899
¤é´Á¡A¦r¦ê¡A¼Æ¦r Âà´«´ú¸Õ- option explicit
- Sub test()
- Dim a&, aa&, b&, d$, sDate As Date, iDate As Date
- sDate = Format(#1/5/2018#, "yyyy/mm/dd")
- iDate = sDate
- d = Format(iDate, "yyyymmdd") '¦r¦ê
- a = Format(iDate, "yyyymmdd") 'ªø¾ã¼Æ
- b = d - 30 '¦r¦ê´î¼Æ¦r¡A¦Û°ÊÂ૬
- Debug.Print a, a - 30
- Debug.Print d, b
- sDate = DateAdd("d", -30, iDate) '¤é´Á-30¤Ñ¡A ¤é´Á
- d = DateAdd("d", -30, iDate) '¤é´Á - 30 ¤Ñ,¦r¦ê
- Debug.Print sDate, d
- a = Val(DateAdd("d", -30, iDate)) '¤é´Á - 30¤Ñ, "2017/12/6" ¥u¦³ "/"«eªº "2017"Âର¼Æ¦r
- aa = Val(iDate) '¤é´ÁÂà¼Æ¦r¡A"2018/1/5" ¥u¦³ "/"«eªº "2018"Âର¼Æ¦r
- Debug.Print a, aa
- End Sub
½Æ»s¥N½X |
|