VB前端,mysql 数据库。
select concat( month(frommonth),'月→',Cast(month(tomonth) AS CHAR),'月') as 征费时段 from mData
或
select concat( month(frommonth),'月→',month(tomonth) ,'月') as 征费时段 from mData
frommonth 和 tomonth 都是 DATE 字段。
结果 12月→1(第二个实际是 12月)
12月→6
请问如何解决这个问题?
谢谢。
select concat( month(frommonth),'月→',Cast(month(tomonth) AS CHAR),'月') as 征费时段 from mData
或
select concat( month(frommonth),'月→',month(tomonth) ,'月') as 征费时段 from mData
frommonth 和 tomonth 都是 DATE 字段。
结果 12月→1(第二个实际是 12月)
12月→6
请问如何解决这个问题?
谢谢。
+-----------------------------------------------------------------+
| concat( month(current_date()),'YY',month(current_date()) ,'YY') |
+-----------------------------------------------------------------+
| 12YY12YY |
+-----------------------------------------------------------------+
1 row in set (0.00 sec)mysql>
CHAR),'月');
+-------------------------------------------------------------------------------
-+
| concat( month(current_date()),'月→',Cast(month(current_date()) AS CHAR),'月')
|
+-------------------------------------------------------------------------------
-+
| 12月→12月
|
+-------------------------------------------------------------------------------
-+
1 row in set (0.00 sec)mysql> select concat( month(current_date()),'月→',month(current_date()) ,'月');+-------------------------------------------------------------------+
| concat( month(current_date()),'月→',month(current_date()) ,'月') |
+-------------------------------------------------------------------+
| 12月→12月 |
+-------------------------------------------------------------------+
1 row in set (0.00 sec)mysql>