web tools rank checker

domain .cn
.net .cn .com.cn
你正在阅览 :: 简体中文:: 学习 ASP SQL VB HTML code

学习 .ASP SQL HTML XML CSS JAVA Perl code study
English Chinese_Traditional Chinese_Simplified

你正在阅览 :: 简体中文 Chinese_Simplified

学习.主题:
首页
ASP
. Active-Server-Flash
. Array
. Connection
. Count
. Counter
. Distinct
. Email
. File
. Folder
. Function
. GetSQLserver
. Header
. mySQL
. Record
. Recordset
. Request
. Response
. Server
. Server-CreateObject
. ServerVariables
. Session
. Special-Symbols
. String
. Sub
. Time
»date
»DateAdd
»datediff
»FormatDateTime
»intDay
»now
»Order-by-Time
»WeekDay
CSS
Ecommerce
HTML
InternetProtocol
JAVA
Microsoft
Robots
SearchEngine
SQL
SQLserver
VBscript
XML

SiteMap

3w....学习.教学 > ASP > time » datediff

3w learning

time >
datediff

Title:

time different between 2 time


Description:

Datediff("how_to_count",oldTime,newTime) how to count :h,m,n,q,ww,w,yyyy,y,s,d h=hour m=month q=quarter y=which date of a year yyyy=which year d=which date of a month n=minute s=second ww=which week of a yeay w=which day of a week


Example Code:

<% response.write Datediff("h",Time1,Time2) %> ---------------------------------------------- <% Set rs= conn.Execute ("select * from aTable " ) if not rs.eof then id=rs("id") FT=rs("Ftime") DD=DateDiff("h",FT,now) if DD>48 then SQLDelete = "Delete from aTabl1 where id1='"&id&"'" conn.Execute SQLDelete end if end if %> similar to dateadd: SQLCheckHits="SELECT SUM(county) AS sumHits from TB1 where Time1 > ' " & DateAdd("h",-8,now) & " ' " Set RSCheckHits = Server.CreateObject("ADODB.Recordset") RSCheckHits.Open SQLCheckHits,conn sumHits= RSCheckHits("sumHits") RSCheckHits.close


Example Result:


delete all rows which time different is bigger than 48 hours


..
...
...

[ 7/27/2008 ]

www learning school add more scripts and tips memo
You are at >>3WS.EZER.COM >> 3WS.EZER.COM/ASP/TIME/DATEDIFF.ASP>>ASP
Helpful link:: SEO web tools :: Live PR | SERP checker
back to top Ezer code adding :: Questions ;email