Skip to content

Tag: sql

using DateDiff to find duration in minutes

I am trying to use Datediff to find out the duration between columnA and columnB. This produces errors. Can anyone please help me with what I’m doing wrong? Answer how about trying this, not sure why you have stime = [exceptions2].starttime and etime = [exceptions2].endtime

How to divide two columns?

I tried to divide two columns from joined tables but the result (value of column relative_duration) is always 0. The query is the following: SELECT t1.[user_1] ,t1.[user_2] ,t1.[…

django: datediff sql queries?

I’m trying to do the equivalent of the following SQL in Django: SELECT * FROM applicant WHERE date_out – date_in >= 1 AND date_out – date_in <= 6 I can do this as a RAW sql query, but this is ...