No announcements

### SQL count function if difference in two date in two column less than 7

Can either of the dates be NULL?
| 4 Replies | 493 Views | Created by ICTC-SPL - Wednesday, September 16, 2015 6:04 AM | Last reply by Ken Sheridan - Wednesday, September 16, 2015 10:23 AM

### Eliminate Count less than two

= 2; /* -------- Output: -------- ean13 --------------- 3 - 444 3 - 444 */
| 2 Replies | 4357 Views | Created by tupacmoche789 - Wednesday, September 19, 2012 4:52 PM | Last reply by Kent Waldrop - Wednesday, September 19, 2012 5:23 PM

### Difference between two dates

> 7 -----------*/ -------Find the number of Minutes between two date/time values------- DECLARE @dt1 DATETIME, @dt2 DATETIME SELECT @dt1 = ...
| 7 Replies | 4882 Views | Created by Avhilash - Thursday, June 6, 2013 7:40 AM | Last reply by Avhilash - Friday, June 7, 2013 2:07 PM

### Want to Calculate a Date with System Date less than two working days

My problem is comparing two dates and find there how many days difference from one another(want to find Except the holidays here).
| 3 Replies | 3304 Views | Created by Raja CRT - Thursday, April 5, 2012 10:17 AM | Last reply by Raja CRT - Monday, April 9, 2012 12:47 PM

### Difference between two dates

For T-SQL, Excel, and SSIS, you don't need to use date calculation functions to arrive at a boolean value.
| 6 Replies | 7388 Views | Created by MSGupta - Wednesday, April 7, 2010 5:11 PM | Last reply by Muqadder - Wednesday, April 14, 2010 9:34 AM

### date difference between two dates

hi All, i have to right a stored proc to find the difference between two dates.
| 10 Replies | 1618 Views | Created by roma_victa - Wednesday, April 1, 2015 8:38 AM | Last reply by gsclayton - Wednesday, April 1, 2015 11:31 AM

### count between two dates

You may get the desired output using below query; DECLARE @START_DATE DATETIME, @END_DATE DATETIME SELECT ...
| 4 Replies | 5064 Views | Created by fasni - Saturday, August 4, 2012 6:28 AM | Last reply by Hasham Niaz - Sunday, August 5, 2012 4:21 PM

### DAX - Count time between two columns - with latest date

Out of these two dates, the last date would be 14/7/2013.
| 6 Replies | 3603 Views | Created by undergrads1 - Sunday, November 24, 2013 3:48 PM | Last reply by undergrads1 - Wednesday, December 4, 2013 6:34 PM

### Count weeks with more then two records

Thank you My week definition is from Sunday to Sunday And yes I meant less then two
| 11 Replies | 978 Views | Created by Lio1972 - Saturday, August 22, 2015 3:08 PM | Last reply by Erland Sommarskog - Sunday, August 23, 2015 8:09 PM

### Outputting the date difference between two date's.

First try to understand, then read BOL about DATEDIFF and DATEADD functions and then come back if there are still questions.
| 5 Replies | 881 Views | Created by Richard I Evans - Friday, September 11, 2015 11:04 AM | Last reply by Erland Sommarskog - Friday, September 11, 2015 12:56 PM

### MDX to return a count between two dates

If your enrollment dimension is loaded through a view, you can just add a calculated column to the view that uses the datediff function.
| 1 Replies | 1450 Views | Created by Cidr - Monday, November 4, 2013 10:05 PM | Last reply by MMilligan - Wednesday, November 6, 2013 9:37 PM

### Subtracting two columns from two different datasets

Edit: If you use 1 as dummy column, use the RowCount function on that column, with scope set to Nothing and ...
| 8 Replies | 8375 Views | Created by Esmari - Tuesday, December 20, 2011 6:18 PM | Last reply by Esmari - Tuesday, December 20, 2011 7:35 PM

### Count of distinct of two or more columns

@mcha: I'm afraid that your solution is a tad flawed consider the following values of myfield1 and myfiled2 abc def ab cdef abcd ...
| 5 Replies | 4907 Views | Created by pscorca - Friday, September 11, 2009 4:33 PM | Last reply by Arif Hasan - Friday, September 11, 2009 5:03 PM

### The datediff function resulted in an overflow.

Perhaps the dates are greater than the expected range due to a data quality issue.
| 2 Replies | 8560 Views | Created by VDeepak - Wednesday, July 2, 2014 9:04 PM | Last reply by Visakh16 - Thursday, July 3, 2014 3:00 AM

### Date difference between two dates by excluding saturday and sunday

Take a look at this blog post Calculating number of workdays between 2 dates For every expert, there is an equal and opposite expert. - ...
| 2 Replies | 8802 Views | Created by Sidhanta - Thursday, February 23, 2012 6:11 AM | Last reply by Naomi N - Friday, February 24, 2012 1:57 AM

### Combine two seperate date and time columns

date column is  database date [DT_DBDATE]         time column is  Unicode string ...
| 10 Replies | 11449 Views | Created by shivn - Tuesday, July 13, 2010 4:05 PM | Last reply by shivn - Tuesday, July 13, 2010 7:05 PM

### How to compare two Date values in two different columns of a table

You can use DateTime.Compare to compare between dates.
| 3 Replies | 2870 Views | Created by Sameer.M.Khan - Wednesday, September 21, 2011 7:35 AM | Last reply by AnshumanSingh - Friday, September 23, 2011 6:19 AM

### Calculate AVG on two dates

Hi Faisal, If you trying to use this column in report then you can use Datediff function in report itself instead of calculating in the query, below is the ...
| 7 Replies | 11588 Views | Created by Faisalkyo - Wednesday, November 14, 2012 1:01 PM | Last reply by Faisalkyo - Thursday, November 15, 2012 6:35 AM