15,935,248 members
Home / Discussions / Database

# Database

 Re: Group by (first letter) Kornfeld Eliyahu Peter12-Mar-14 20:03 Kornfeld Eliyahu Peter 12-Mar-14 20:03
 Re: Group by (first letter) nelsonpaixao16-Mar-14 9:50 nelsonpaixao 16-Mar-14 9:50
 sum of datediff to many dates ahmad_yossef11-Mar-14 4:08 ahmad_yossef 11-Mar-14 4:08
 Re: sum of datediff to many dates Tim Carmichael11-Mar-14 5:40 Tim Carmichael 11-Mar-14 5:40
 Re: sum of datediff to many dates ahmad_yossef11-Mar-14 23:05 ahmad_yossef 11-Mar-14 23:05
 Re: sum of datediff to many dates Tim Carmichael12-Mar-14 10:57 Tim Carmichael 12-Mar-14 10:57
 Re: sum of datediff to many dates ahmad_yossef12-Mar-14 23:19 ahmad_yossef 12-Mar-14 23:19
 Re: sum of datediff to many dates Richard Deeming13-Mar-14 1:10 Richard Deeming 13-Mar-14 1:10
 `1456 == (3 × 365) + 361`. That's clearly not 4 years and 1 day. The problem is that you're assuming 365 days per year, but only 30 days per month. `(30 × 12) = 360`, so you've lost five days. You need to assume `(365 / 12) = 30.4166666...` days per month, which will give you an answer of 3 years, 11 months and 27 days. SQL ```SELECT dayss, dayss / 365 As years, Cast(Floor((dayss % 365) * 12 / 365.0) As int) As Months, (dayss % 365) - Cast(Floor((dayss % 365) * 12 / 365.0) * 365.0 / 12 As int) As days FROM dbo.lv_npay_tmp3``` "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
 Re: sum of datediff to many dates Kornfeld Eliyahu Peter11-Mar-14 23:48 Kornfeld Eliyahu Peter 11-Mar-14 23:48
 Re: sum of datediff to many dates ahmad_yossef12-Mar-14 2:23 ahmad_yossef 12-Mar-14 2:23
 Re: sum of datediff to many dates Richard MacCutchan12-Mar-14 3:53 Richard MacCutchan 12-Mar-14 3:53
 Re: sum of datediff to many dates jschell14-Mar-14 12:15 jschell 14-Mar-14 12:15
 DSN Lek Plepi11-Mar-14 1:27 Lek Plepi 11-Mar-14 1:27
 Re: DSN cdpsource11-Mar-14 2:14 cdpsource 11-Mar-14 2:14
 Re: DSN Mycroft Holmes11-Mar-14 2:25 Mycroft Holmes 11-Mar-14 2:25
 Ho to avoid Not In & In clause in my query member002611-Mar-14 0:43 member0026 11-Mar-14 0:43
 Re: Ho to avoid Not In & In clause in my query Bernhard Hiller11-Mar-14 1:04 Bernhard Hiller 11-Mar-14 1:04
 Re: Ho to avoid Not In & In clause in my query member002611-Mar-14 18:08 member0026 11-Mar-14 18:08
 Re: Ho to avoid Not In & In clause in my query thatraja11-Mar-14 2:07 thatraja 11-Mar-14 2:07
 Re: Ho to avoid Not In & In clause in my query GuyThiebaut11-Mar-14 3:54 GuyThiebaut 11-Mar-14 3:54
 Adding Sales Totals from multiple tables jkirkerx9-Mar-14 10:54 jkirkerx 9-Mar-14 10:54
 Re: Adding Sales Totals from multiple tables Mycroft Holmes9-Mar-14 14:16 Mycroft Holmes 9-Mar-14 14:16
 Re: Adding Sales Totals from multiple tables jkirkerx9-Mar-14 17:44 jkirkerx 9-Mar-14 17:44
 Re: Adding Sales Totals from multiple tables Jörgen Andersson9-Mar-14 22:01 Jörgen Andersson 9-Mar-14 22:01
 Re: Adding Sales Totals from multiple tables jkirkerx10-Mar-14 6:26 jkirkerx 10-Mar-14 6:26
 Last Visit: 31-Dec-99 18:00     Last Update: 12-Jul-24 1:29 Refresh ᐊ Prev1...207208209210211212213214215216 Next ᐅ

General    News    Suggestion    Question    Bug    Answer    Joke    Praise    Rant    Admin

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.