例如 :几岁?
问题补充:不满一岁的显示几个月?
如何在前台套打印会员生日?
- 提问者: 别怀远
- 等级:普通会员
- 时间:2018-10-29 12:26
- 悬赏:0
- 解决时间:2018-11-08 12:26
回答 共 2 条
你好,问题描述不是很清楚,请加技术部的qq:4008315218,详细说明
- 回答者:赢通技术4
- 等级:钻石会员
- 时间:2018-10-29 14:20
你好:根据会员阳历生日和当天日期计算出会员年龄,不满一年的显示为月。函数如下:
if (integer(left(string(today()),4))-integer(db_data2(~"select vip_birth_year from t_vip_info where vip_no=?~",vip_no))>0,string( integer(left(string(today()),4))-integer(db_data2(~"select vip_birth_year from t_vip_info where vip_no=?~",vip_no)))+~"岁~",string(integer(db_data2(~"select datediff(month, CONVERT (datetime,cast(vip_birth_year as varchar(4))+right(cast(0 as varchar(1))+cast(vip_birth_month as varchar(2)),2)+right(cast(0 as varchar(1))+cast(vip_birth_day as varchar(2)),2),23),getdate()) from t_vip_info where vip_no=?~",vip_no)))+~"月~" )
if (integer(left(string(today()),4))-integer(db_data2(~"select vip_birth_year from t_vip_info where vip_no=?~",vip_no))>0,string( integer(left(string(today()),4))-integer(db_data2(~"select vip_birth_year from t_vip_info where vip_no=?~",vip_no)))+~"岁~",string(integer(db_data2(~"select datediff(month, CONVERT (datetime,cast(vip_birth_year as varchar(4))+right(cast(0 as varchar(1))+cast(vip_birth_month as varchar(2)),2)+right(cast(0 as varchar(1))+cast(vip_birth_day as varchar(2)),2),23),getdate()) from t_vip_info where vip_no=?~",vip_no)))+~"月~" )
- 回答者:ytkf007
- 等级:问不倒翁
- 时间:2018-10-29 17:26
快到期问题