# Understanding Line in SQL Statement

Page 1 of 1

## 3 Replies - 1105 Views - Last Post: 11 October 2012 - 07:57 AM

### #1 Scorpion_134

Reputation: 0
• Posts: 7
• Joined: 25-April 11

# Understanding Line in SQL Statement

Posted 11 October 2012 - 06:37 AM

I have recently started learning more and more about SQL, but this statement has me confused. If you could tell me what this means that would be great. Thanks!!

```(DateDiff(dd, ISNULL(x.CDate, '1/1/1900'), y.DDate) > 5)

```

Is This A Good Question/Topic? 0

## Replies To: Understanding Line in SQL Statement

### #2 modi123_1

• Suitor #2

Reputation: 11608
• Posts: 45,766
• Joined: 12-June 08

## Re: Understanding Line in SQL Statement

Posted 11 October 2012 - 07:10 AM

Just break it down.

(dd, '-- from that link dd is day.. so are getting the number of days between two dates.
x.CDate, '-- some column name
'1/1/1900') '-- if that column is null then use this date.
, y.DDate) '-- find the number of days between x.CDate (or 01/01/1900 if x.Cdate is null) to y.Ddate
> 5)

'-- if that number of days between said dates is greater than five return true or else false.

### #3 Scorpion_134

Reputation: 0
• Posts: 7
• Joined: 25-April 11

## Re: Understanding Line in SQL Statement

Posted 11 October 2012 - 07:44 AM

modi123_1, on 11 October 2012 - 07:10 AM, said:

Just break it down.

(dd, '-- from that link dd is day.. so are getting the number of days between two dates.
x.CDate, '-- some column name
'1/1/1900') '-- if that column is null then use this date.
, y.DDate) '-- find the number of days between x.CDate (or 01/01/1900 if x.Cdate is null) to y.Ddate
> 5)

'-- if that number of days between said dates is greater than five return true or else false.

Thanks for your Reply. I am somewhat new to SQL so I was just making sure I was reading it correctly.

### #4 modi123_1

• Suitor #2

Reputation: 11608
• Posts: 45,766
• Joined: 12-June 08

## Re: Understanding Line in SQL Statement

Posted 11 October 2012 - 07:57 AM

Hmmm.. well next time I'll have to make you tell me what you think it says first. Also I just noticed this is mysql not mssql... the function explanation is the same but you may get a bit more mileage out of hitting up the mysql search bar.

Page 1 of 1

 .related ul{list-style-type:circle;font-size:12px;font-weight:bold;}.related li{margin-bottom:5px;background-position:left 7px!important;margin-left:-35px;}.related h2{font-size:18px;font-weight:bold;}.related a{color:blue;}