Click here to Skip to main content
15,394,799 members
Home / Discussions / Database
   

Database

 
QuestionBLOB or external storage... Pin
Kornfeld Eliyahu Peter26-Jan-15 20:57
professionalKornfeld Eliyahu Peter26-Jan-15 20:57 
AnswerRe: BLOB or external storage... Pin
den2k8826-Jan-15 21:32
professionalden2k8826-Jan-15 21:32 
AnswerRe: BLOB or external storage... Pin
GuyThiebaut26-Jan-15 21:48
professionalGuyThiebaut26-Jan-15 21:48 
AnswerRe: BLOB or external storage... Pin
Jörgen Andersson26-Jan-15 22:13
professionalJörgen Andersson26-Jan-15 22:13 
AnswerRe: BLOB or external storage... Pin
Richard Deeming27-Jan-15 1:50
mveRichard Deeming27-Jan-15 1:50 
GeneralRe: BLOB or external storage... Pin
Jörgen Andersson27-Jan-15 3:06
professionalJörgen Andersson27-Jan-15 3:06 
AnswerRe: BLOB or external storage... Pin
deepakdynamite28-Jan-15 0:30
Memberdeepakdynamite28-Jan-15 0:30 
QuestionDatediff function Pin
Ambertje26-Jan-15 2:18
MemberAmbertje26-Jan-15 2:18 
Hello,

I want to calculate the difference between 2 dates and times in seconds.

SQL
, Datediff(SECOND,
        convert(datetime, [START_DATE] + ' ' + [START_TIME]),
        convert(datetime, [END_DATE] + ' ' + [END_TIME]))                                               AS M_Time_Worked



Nog problem with the function but when I come across a record where the Start_Date is empty then I get an overflow (I know that you can calculate max 68 years worth of seconds)

I've tried to use a Case statement but it wont work like this:
SQL
, CASE WHEN START_DATE IS NULL THEN START_DATE = END_DATE
    ELSE
    Datediff(SECOND,
        convert(datetime, [START_DATE] + ' ' + [START_TIME]),
        convert(datetime, [END_DATE] + ' ' + [END_TIME]))   END                                         AS M_Time_Worked


Does anyone know how I can handle empty values for a DateDiff() please?

Kind regards,
Ambertje
AnswerRe: Datediff function Pin
Chris Quinn26-Jan-15 2:25
MemberChris Quinn26-Jan-15 2:25 
GeneralRe: Datediff function Pin
Ambertje26-Jan-15 2:34
MemberAmbertje26-Jan-15 2:34 
GeneralRe: Datediff function Pin
Chris Quinn26-Jan-15 2:42
MemberChris Quinn26-Jan-15 2:42 
GeneralRe: Datediff function Pin
Ambertje26-Jan-15 3:12
MemberAmbertje26-Jan-15 3:12 
GeneralRe: Datediff function Pin
Chris Quinn26-Jan-15 3:18
MemberChris Quinn26-Jan-15 3:18 
GeneralRe: Datediff function Pin
Ambertje26-Jan-15 3:26
MemberAmbertje26-Jan-15 3:26 
GeneralRe: Datediff function Pin
Jörgen Andersson26-Jan-15 21:17
professionalJörgen Andersson26-Jan-15 21:17 
AnswerRe: Datediff function Pin
PIEBALDconsult26-Jan-15 5:57
professionalPIEBALDconsult26-Jan-15 5:57 
GeneralRe: Datediff function Pin
Ambertje26-Jan-15 22:21
MemberAmbertje26-Jan-15 22:21 
GeneralRe: Datediff function Pin
Corporal Agarn27-Jan-15 3:46
professionalCorporal Agarn27-Jan-15 3:46 
GeneralRe: Datediff function Pin
Ambertje3-Feb-15 5:36
MemberAmbertje3-Feb-15 5:36 
GeneralRe: Datediff function Pin
Ambertje27-Jan-15 0:03
MemberAmbertje27-Jan-15 0:03 
QuestionAccess query convert to MSSQL query Pin
Ray Raymos24-Jan-15 9:12
MemberRay Raymos24-Jan-15 9:12 
AnswerRe: Access query convert to MSSQL query Pin
Mycroft Holmes24-Jan-15 12:49
professionalMycroft Holmes24-Jan-15 12:49 
QuestionERD fee management system keep the record of whole year Pin
Haidar ali23-Jan-15 17:04
MemberHaidar ali23-Jan-15 17:04 
AnswerRe: ERD fee management system keep the record of whole year Pin
Richard MacCutchan23-Jan-15 22:45
mveRichard MacCutchan23-Jan-15 22:45 
GeneralRe: ERD fee management system keep the record of whole year Pin
Mycroft Holmes23-Jan-15 23:09
professionalMycroft Holmes23-Jan-15 23:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

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