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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -