<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
        主站蜘蛛池模板: 99久久精品免费视频| 国产性生大片免费观看性| 国产免费丝袜调教视频| 亚洲色四在线视频观看| 50岁老女人的毛片免费观看 | 免费看大美女大黄大色| 亚洲人成综合网站7777香蕉| 国内精品乱码卡1卡2卡3免费| 亚洲专区中文字幕| 欧美好看的免费电影在线观看| 久久精品国产亚洲av麻豆图片| 最近中文字幕mv手机免费高清| 国产精品亚洲专区无码牛牛| 免费在线观看中文字幕| 成人片黄网站色大片免费观看cn| 亚洲色无码一区二区三区| 久久精品免费观看| 亚洲欧洲精品视频在线观看| 青娱乐免费视频在线观看| 亚洲中文字幕无码久久2020| 国产一级特黄高清免费大片| 永久免费无码日韩视频| 亚洲国产精品久久久久婷婷老年| 最近免费中文在线视频| 亚洲AV色无码乱码在线观看| 国产亚洲午夜高清国产拍精品| 日本一道本不卡免费| 亚洲男人天堂2022| 亚洲午夜精品久久久久久浪潮| 久久免费国产视频| 亚洲大码熟女在线观看| 亚洲人成在线播放网站| 女人18一级毛片免费观看| 亚洲天堂免费在线视频| 亚洲乱码在线视频| 内射无码专区久久亚洲| 777爽死你无码免费看一二区| 美女免费视频一区二区三区| 亚洲av不卡一区二区三区| 国产美女精品久久久久久久免费| 嫩草影院在线播放www免费观看|