使用IIF 判斷DataSet傳回欄位值傳回True 就顯示 "是",反之顯示"否"
=First(IIF(Fields!IsAll.Value = "True","是","否"), "DataSet1")
2015年1月14日 星期三
2015年1月13日 星期二
[Jquery]尋找元素
<li onclick="SetRoomNumber('209', '雙人房', '');" class="list">
<span class="fontSize14px fontweight fontColorBlue2">209</span>
<div class="roomStatusTxt">
<span class="fontColorBlack">空房</span>
<span class="fontColorBrown">雙人房</span>
</div>
</li>
尋找items 下li裡span class = "fontColorBlack"
$("#items").on("click", "li", function (e) {
$(this).find("span.fontColorBlack").html() ;
});
結果:空房
<span class="fontSize14px fontweight fontColorBlue2">209</span>
<div class="roomStatusTxt">
<span class="fontColorBlack">空房</span>
<span class="fontColorBrown">雙人房</span>
</div>
</li>
尋找items 下li裡span class = "fontColorBlack"
$("#items").on("click", "li", function (e) {
$(this).find("span.fontColorBlack").html() ;
});
結果:空房
2015年1月8日 星期四
2015年1月2日 星期五
[JSON] 將傳回JSON日期格式化
Birthday傳回格式 : /Date(1418900173730)/
var parsedDate = new Date(parseInt(JData[i].Birthday.substr(6)));
var customBirthday = new Date(parsedDate);
customBirthday = customBirthday.getFullYear() + "/" + (customBirthday.getMonth() + 1) + "/" + customBirthday.getDate();
格式化後:2014/12/18
var parsedDate = new Date(parseInt(JData[i].Birthday.substr(6)));
var customBirthday = new Date(parsedDate);
customBirthday = customBirthday.getFullYear() + "/" + (customBirthday.getMonth() + 1) + "/" + customBirthday.getDate();
格式化後:2014/12/18
2014年12月31日 星期三
[SQL] IN 使用資料表值函示傳回table篩選條件
資料列表
1.建立function
CREATE FUNCTION GetWeekStrings (@roomListID int)
RETURNS TABLE
AS
RETURN (
SELECT [Week] FROM RoomOpenSet WHERE RoomListID= 1
)
2.找出資料Week欄位不等於 2,3,4
SELECT *, DATEPART(WEEKDAY, StartDate -1) as [Week] FROM RoomOpen WHERE RoomListID = 1 AND convert(varchar,DATEPART(WEEKDAY, StartDate -1)) not in
(
Select * From GetWeekStrings(1)
)
結果為下表,過濾掉星期2,3,4 只撈出星期五的資料
[SQL]如何將多筆資料列的值組成同一欄位
原本的資料列表
但是我想將Week欄位組成 2,3,4 使用stuff
select stuff(Strings.MarkUp,1,1,'') as [Week]
from
(
select RoomListID,
(
SELECT ',' +cast([Week] AS NVARCHAR)
FROM RoomOpenSet
WHERE RoomListID=ro2.RoomListID
for xml path('')
)MarkUp
from RoomOpenSet ro2
GROUP BY RoomListID
) as Strings
where RoomListID = 1
from
(
select RoomListID,
(
SELECT ',' +cast([Week] AS NVARCHAR)
FROM RoomOpenSet
WHERE RoomListID=ro2.RoomListID
for xml path('')
)MarkUp
from RoomOpenSet ro2
GROUP BY RoomListID
) as Strings
where RoomListID = 1
2014年12月17日 星期三
[JavaScript]格林威治時間轉換
dates = Fri Dec 19 2014 12:00:00 GMT+0800 (台北標準時間)
var d = new Date(dates);
var year = d.getFullYear();
var month = d.getMonth() + 1;
var day = d.getDate();
alert(year + "/" + month + "/" + day)
輸出結果: 2014/12/19
var d = new Date(dates);
var year = d.getFullYear();
var month = d.getMonth() + 1;
var day = d.getDate();
alert(year + "/" + month + "/" + day)
輸出結果: 2014/12/19
訂閱:
文章 (Atom)
Visual Studio JS intellisense 失效解決方式
試了好久,發現到工具>選項>IntelliCode js項目設定啟用,重新開啟VS就正常了! 後來發現是TypeScript3.2版有問題停用,使用4.3版的TypeScript即可
-
開啟記事本將以下程式碼貼入存成.bat @ECHO OFF set x=%date:~0,4%%date:~5,2%%date:~8,2% CD C:\Windows\System32\winevt\Logs COPY Application.evtx D:\bak\...
-
使用truncate table 時會出現 無法截斷資料表 'xxx',因為該資料表正由 FOREIGN KEY 條件約束參考解決方式 先刪除再重建自動編號即可。 DELETE table; DBCC CHECKIDENT('table...



