{"id":1422,"date":"2015-04-20T15:40:21","date_gmt":"2015-04-20T06:40:21","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=1422"},"modified":"2015-08-26T02:05:02","modified_gmt":"2015-08-25T17:05:02","slug":"dateadd","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/dateadd\/","title":{"rendered":"\u65e5\u4ed8\u6642\u523b\uff1a\u65e5\u4ed8\u6642\u523b\u30c7\u30fc\u30bf\u3092\u8a08\u7b97\uff08 DateAdd \u95a2\u6570 \uff09"},"content":{"rendered":"<h2>DateAdd \u95a2\u6570\uff08\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u5024\u3092\u52a0\u7b97\u30fb\u6e1b\u7b97\u7d50\u679c\u3092\u53d6\u5f97\uff09<\/h2>\n<br \/>\n<div class=\"m30-l\">\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p><em>result_date<\/em> = <strong>DateAdd<\/strong> ( <em>interval<\/em>, <em>number<\/em>, <em>date<\/em> )<\/p>\n<\/div>\n<br \/>\n<h3>\u3010\u5f15\u6570\u30fb\u623b\u308a\u5024\u3011<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>interval&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<span class=\"red\">\u52a0\u6e1b\u3059\u308b\u6642\u9593\u9593\u9694\u306e<strong>\u5358\u4f4d<\/strong>\u3092\u6587\u5b57\u5217\u5f0f<\/span>\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\uff08<a href=\"#dateadd_interval\">\u4e0b\u8868\u300c\u6642\u9593\u9593\u9694\u306e\u5358\u4f4d\u3092\u793a\u3059\u5358\u4f4d\u300d\u3092\u53c2\u7167<\/a>\uff09<\/li>\n<li>number&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<span class=\"red\">\u52a0\u6e1b\u3059\u308b\u6642\u9593\u9593\u9694\u306e<strong>\u6570\u5024\u30fb\u6570\u5f0f<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\uff08\u5c06\u6765\u306e\u65e5\u6642\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u6b63\u6570\u3001\u904e\u53bb\u306e\u65e5\u6642\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u8ca0\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\uff09\u3002<\/li>\n<li>date&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5143\u3068\u306a\u308b<strong>\u65e5\u4ed8\u30fb\u6642\u523b<\/strong>\u3092\u6307\u5b9a\u3057\u307e\u3059\uff08\u5185\u90e8\u51e6\u7406\u5f62\u5f0f Date \u306e\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\u306e\u5024\u3001\u3082\u3057\u304f\u306f\u30ea\u30c6\u30e9\u30eb\u6587\u5b57\u5217\uff09\u3002<\/li>\n<li>result_date&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5f15\u6570 <em>date<\/em> \u306b\u3001<em>number<\/em> \u3092\u52a0\u7b97\uff08\u6e1b\u7b97\uff09\u3057\u305f\u65e5\u4ed8\uff08\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\u306e\u5024\uff09\u3002<\/li>\n<\/ul>\n<br \/>\n<p id=\"dateadd_interval\" class=\"caution4\">\u6642\u9593\u9593\u9694\u306e\u5358\u4f4d\u3092\u793a\u3059\u5358\u4f4d\uff08<em>interval<\/em> \u306b\u6307\u5b9a\u3059\u308b\u5024\uff09\u306e\u4e00\u89a7<\/p>\n<div class=\"m30-l\">\n<table>\n<tr>\n<td align = \"center\" width=\"100\" bgcolor=\"#ffffcc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"150\" bgcolor=\"#ffffcc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffcc\"><strong>\u5099\u8003<\/strong><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">yyyy<\/td>\n<td align = \"center\" width=\"150\">\u5e74<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">q<\/td>\n<td align = \"center\" width=\"150\">\u56db\u534a\u671f<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">m<\/td>\n<td align = \"center\" width=\"150\">\u6708<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">y<\/td>\n<td align = \"center\" width=\"150\">\u5e74\u9593\u901a\u7b97\u65e5<\/td>\n<td width=\"150\">\u203b <strong>d<\/strong> \u3092\u8a2d\u5b9a\u3057\u305f\u6642\u3068\u540c\u3058\u7d50\u679c\u306b\u306a\u308b<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">d<\/td>\n<td align = \"center\" width=\"150\">\u65e5<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">w<\/td>\n<td align = \"center\" width=\"150\">\u9031\u65e5<\/td>\n<td width=\"150\">\u203b <strong>d<\/strong> \u3092\u8a2d\u5b9a\u3057\u305f\u6642\u3068\u540c\u3058\u7d50\u679c\u306b\u306a\u308b<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">ww<\/td>\n<td align = \"center\" width=\"150\">\u9031<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">h<\/td>\n<td align = \"center\" width=\"150\">\u6642<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">n<\/td>\n<td align = \"center\" width=\"150\">\u5206<\/td>\n<td width=\"150\">\u203b <span class=\"red\"><strong>\u6ce8\u610f\u300cm\u300d\u3067\u306f\u306a\u304f\u300cn\u300d<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"100\">s<\/td>\n<td align = \"center\" width=\"150\">\u79d2<\/td>\n<td align = \"center\" width=\"150\"><\/td>\n<\/tr>\n<\/table>\n<\/div>\n<\/div>\n<br \/><br \/>\n<h2>DateAdd \u95a2\u6570\u306e\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"DateAdd \u95a2\u6570\u306e\u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_DateAdd()\r\n\r\n    Dim myDate As Date\r\n    Dim msg\r\n    \r\n    myDate = #1\/1\/2015#\r\n    \r\n    msg = \"\u5143\u65e5\u4ed8\u3000\u3000\u3000 \uff1a\" & myDate & Chr(13) & _\r\n          \"d\uff08\u65e5\uff09\u30003200\uff1a\" & DateAdd(\"d\", 3200, myDate) & Chr(13) & _\r\n          \"y\uff08\u5e74\u65e5\uff093200\uff1a\" & DateAdd(\"y\", 3200, myDate) & Chr(13) & _\r\n          \"w\uff08\u9031\u65e5\uff093200\uff1a\" & DateAdd(\"w\", 3200, myDate) & Chr(13) & _\r\n          \"d\uff08\u65e5\uff09\u3000 -32\uff1a\" & DateAdd(\"d\", -32, myDate) & Chr(13) & _\r\n          \"y\uff08\u5e74\u65e5\uff09 -32\uff1a\" & DateAdd(\"y\", -32, myDate) & Chr(13) & _\r\n          \"w\uff08\u9031\u65e5\uff09 -32\uff1a\" & DateAdd(\"w\", -32, myDate) & Chr(13) & _\r\n          \"yyyy\uff08\u5e74\uff09\u30001\uff1a\" & DateAdd(\"yyyy\", 1, myDate) & Chr(13) & _\r\n          \"q\uff08\u56db\u534a\u671f\uff09 1\uff1a\" & DateAdd(\"q\", 1, myDate) & Chr(13) & _\r\n          \"n\uff08\u5206\uff0940\u3000\u3000\uff1a\" & DateAdd(\"n\", 40, myDate) & Chr(13) & _\r\n          \"ww\uff08\u9031\uff091\u3000\u3000\uff1a\" & DateAdd(\"ww\", 1, myDate)\r\n    \r\n    Debug.Print msg\r\n    \r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/dateadd01.jpg?ssl=1\" rel=\"lightbox[1422]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/dateadd01.jpg?resize=333%2C400&#038;ssl=1\" alt=\"DateAdd \u95a2\u6570\u3000\u4f7f\u7528\u4f8b\" width=\"333\" height=\"400\" class=\"alignnone size-medium wp-image-1430\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/dateadd01.jpg?resize=333%2C400&amp;ssl=1 333w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/dateadd01.jpg?w=547&amp;ssl=1 547w\" sizes=\"(max-width: 333px) 100vw, 333px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>DateAdd \u95a2\u6570\uff08\u65e5\u4ed8\u30fb\u6642\u523b\u306e\u5024\u3092\u52a0\u7b97\u30fb\u6e1b\u7b97\u7d50\u679c\u3092\u53d6\u5f97\uff09 \u3010\u66f8\u5f0f\u3011 resu &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1434,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":"\u65e5\u4ed8\u6642\u523b\uff1a\u65e5\u4ed8\u6642\u523b\u30c7\u30fc\u30bf\u3092\u8a08\u7b97\uff08 DateAdd \u95a2\u6570 \uff09"},"categories":[37],"tags":[139,63,38,118,140],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/dateadd01-333x4001.jpg?fit=333%2C400&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-dateadd","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1422"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=1422"}],"version-history":[{"count":11,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1422\/revisions"}],"predecessor-version":[{"id":3372,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1422\/revisions\/3372"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/1434"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=1422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=1422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=1422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}