<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        sql:生日三個月內有效

        來源:懂視網 責編:小采 時間:2020-11-09 10:24:42
        文檔

        sql:生日三個月內有效

        sql:生日三個月內有效:DECLARE @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total int,@firthmonth int,@thirmonth in
        推薦度:
        導讀sql:生日三個月內有效:DECLARE @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total int,@firthmonth int,@thirmonth in

        DECLARE @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total int,@firthmonth int,@thirmonth in

        DECLARE @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total int,@firthmonth int,@thirmonth int,@now datetime,@vipno nvarchar(10) --參數 set @vipno='8888888' set @now='2014-01-25' set @year=Year(@now) select @birthday=birthday from vip1 where vipno=@vipno set @month=month(@birthday) set @day=day(@birthday) set @str=cast(@year as varchar(4))+'-'+cast(@month as varchar(2))+'-'+cast(@day as varchar(2)) set @birthday=cast(@str as datetime) --會員生日有效生首日起至3個月內有效 set @firthbirthday=DATEADD(mm, DATEDIFF(mm,0,@birthday)-2, 0)--DATEADD(mm, DATEDIFF(mm,0,@birthday), 0) --當月的第一天 --set @thirdbirthday=DATEADD(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate())+3, 0)) --后三個月最后的一天 SELECT @firthbirthday=DATEADD(MONTH,-2,DATEADD(MONTH,DATEDIFF(MONTH,0,@birthday),0)) --select cast(@firthbirthday as datetime) --set @firthbirthday=DATEADD(MONTH,-2,DATEADD(MONTH,DATEDIFF(MONTH,0,@birthday),0))--DATEADD(Month,0,CONVERT(datetime,CONVERT(char(8),getdate(),120)+'1')) --select @firthbirthday --DATEADD(mm,0, DATEDIFF(mm,0,@birthday), 0) --前三個月的第一天 --set @firthbirthday=convert(datetime, @thirdbirthday) --SELECT 三個月有效 塗聚文 涂聚文 set @firthmonth=month(@now)-2 set @thirmonth=month(@now) set @thirdbirthday=DATEADD(ms,-3,DATEADD(mm, DATEDIFF(mm,0,@now)+1, 0)) --當月最后的一天 set @thirdbirthday=cast(@thirdbirthday as datetime) set @statbirthday=DATEADD(mm, DATEDIFF(mm,0,@birthday)-13, 0) set @endbirthday=DATEADD(ms,-3,DATEADD(mm, DATEDIFF(mm,0,@birthday)-1, 0)) --select @statbirthday,@endbirthday,@firthbirthday,@thirdbirthday,@birthday,@firthmonth,@thirmonth --以月份來吧 SELECT * FROM View_birthdayVipdlyList WHERE DATEDIFF(month,NowBirthday,@now)>=0 and DATEDIFF(month,NowBirthday,@now)<=2 and vipno=@vipno order by VipBirthdayDate desc --SELECT * FROM vip1 WHERE indate>@statbirthday AND indate<@endbirthday and month(birthday)>=@firthmonth and month(birthday)<=@thirmonth --and vipno=@vipno --SELECT @total=ISNULL(SUM(amount),0) FROM View_birthdayVipdlyList WHERE indate>@statbirthday AND indate<@endbirthday and month(birthday)>=@firthmonth and month(birthday)<=@thirmonth and vipno=@vipno --SELECT @total=@total*.01 SELECT count(*) as 'total' FROM View_birthdayVipdlyList WHERE DATEDIFF(month,NowBirthday,getdate())>=0 and DATEDIFF(month,NowBirthday,getdate())<=2 and vipno=@vipno if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetVipNowBirthday]') and xtype in (N'FN', N'IF', N'TF')) drop function [dbo].[GetVipNowBirthday] GO CREATE function GetVipNowBirthday ( @vipno nvarchar(10), --參數 @now datetime ) returns datetime AS begin declare @NowBirthday datetime, @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(40),@total decimal select @birthday=birthday from vip1 where vipno=@vipno and birthday is not null set @year=Year(@now) if month(@now)=1 and month(@birthday)=12 begin set @year=@year-1 end if month(@now)=1 and month(@birthday)=11 begin set @year=@year-1 end if month(@now)=2 and month(@birthday)=12 begin set @year=@year-1 end set @month=month(@birthday) set @day=day(@birthday) set @str=cast(@year as varchar(4))+'-'+cast(@month as varchar(2))+'-'+cast(@day as varchar(2)) set @NowBirthday=convert(datetime,@str) ---cast(@str as datetime) return @NowBirthday end GO select top 100 vipno,birthday,[dbo].[GetVipNowBirthday](vipno,'2014-03-23') as 'now' from dbo.vip1 where month(birthday)=12 or month(birthday)=11 ,

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        sql:生日三個月內有效

        sql:生日三個月內有效:DECLARE @birthday datetime,@stat datetime,@end datetime,@statbirthday datetime,@endbirthday datetime,@thirdbirthday datetime,@firthbirthday datetime, @year int,@month int , @day int,@str varchar(20),@total int,@firthmonth int,@thirmonth in
        推薦度:
        標簽: 生日 三個月 三個
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲视频在线一区二区| 日韩免费毛片视频| 花蝴蝶免费视频在线观看高清版| 毛片基地看看成人免费| 一区二区三区福利视频免费观看| **俄罗斯毛片免费| 18禁无遮挡无码网站免费| 免费一级特黄特色大片在线| 亚洲动漫精品无码av天堂| 亚洲精品中文字幕无乱码麻豆| 亚洲av成人无码网站…| 中国好声音第二季免费播放| 日韩中文字幕免费| 国产精品亚洲片在线花蝴蝶| 无码一区二区三区免费| 亚洲黄色在线网站| 两个人看的www高清免费视频 | 亚洲日本va一区二区三区| 亚洲免费在线观看| 成年免费大片黄在线观看岛国 | 亚洲视屏在线观看| aa级一级天堂片免费观看| 亚洲女子高潮不断爆白浆| 亚洲成AV人在线观看网址| 亚洲中文字幕精品久久| 日本片免费观看一区二区| 国产亚洲精久久久久久无码| 精品女同一区二区三区免费播放 | 亚洲va精品中文字幕| 国产一级黄片儿免费看| 亚洲午夜精品一区二区| 精品国产呦系列在线观看免费| 久久久久亚洲AV成人无码| 成人片黄网站色大片免费观看cn| 亚洲午夜久久久精品影院| 成年在线网站免费观看无广告 | 99久久免费国产香蕉麻豆| 亚洲精品自拍视频| 免费国产黄网站在线观看可以下载| 丁香五月亚洲综合深深爱| 免费国产黄网站在线观看动图|