<%
function HuynhMaiAnhKiet_Date()
intDate = Date()
intWeek = Weekday(intDate)
intDay = Day(intDate)
intMonth = Month(intDate)
intYear = Year(intDate)
Select Case Weekday(intWeek)
Case 1: ngaythu= "chu-nhat"
Case 2: ngaythu= "thu-hai"
Case 3: ngaythu= "thu-ba"
Case 4: ngaythu= "thu-tu"
Case 5: ngaythu= "thu-nam"
Case 6: ngaythu= "thu-sau"
Case 7: ngaythu= "thu-bay"
End Select
if Len(intDay)=1 Then intDay = "0" & intDay
if Len(intMonth)=1 Then intMonth = "0" & intMonth
HuynhMaiAnhKiet_Date=ngaythu
end function
%>
<%
dim ngaythu
ngaythu = HuynhMaiAnhKiet_Date()
Dim rs_i1n
Dim rs_i1n_numRows
Set rs_i1n = Server.CreateObject("ADODB.Recordset")
rs_i1n.ActiveConnection = MM_connDUportal_STRING
rs_i1n.Source = "SELECT top 15 * " &_
"FROM DATAS, CATEGORIES, CHANNELS " &_
"WHERE CAT_CHANNEL = CHA_ID AND DAT_CATEGORY = CAT_ID AND DAT_APPROVED=1 AND CHA_ACTIVE=1 AND CAT_NAME_VN LIKE '%" & ngaythu & "%' " &_
"ORDER BY DAT_ID DESC, DAT_PRICE ASC"
rs_i1n.CursorType = 3
rs_i1n.CursorLocation = 2
rs_i1n.LockType = 3
rs_i1n.Open()
rs_i1n_numRows = 0
NumofRecord1 = rs_i1n.RecordCount
%>
Thuật toán này được dùng thành công cho website sau:
Rất cảm ơn tài liệu sau đã giúng chúng tôi viết được thuật toán này một cách đơn giản nhất.
Ngày 10-05-2013
Trịnh Văn Thùy