sql - Find the difference between two date fields that are within a certain time parameter -
i have tried few ways here pseudo-code sql:
select count(*) counter startdate , enddate 30 minutes , archived = 1.
the datatypes mssql fields datetime
the other idea had bring select
statement , add dateadd
datdiff
not sure how account 2 seperate fields (startdate
,enddate
)...
i hope can straighten me out.
select count(*) yourtable datediff(minute,startdate,enddate) <= 30 , archived = 1
Comments
Post a Comment