[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

TimeStamp difference

Posted on 2008-06-23
4
Medium Priority
?
457 Views
Last Modified: 2011-10-03
Hi
i get the result in that two columns having date and time.for example first column is Acutal created date and second column is time stamp.
i need in third column is difference between first and second columns so that i can get elapsed time taken to submit the application.
i am not able to find asp zone .please let me know the zone.
i am using asp ,db2.

Thank You

0
Comment
Question by:tracy_p
4 Comments
 

Author Comment

by:tracy_p
ID: 21850792
i addded the comment
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 21850820
what do you mean by asp zone?
0
 
LVL 18

Assisted Solution

by:Dave Ford
Dave Ford earned 400 total points
ID: 21850971

So, did the TIMESTAMPDIFF function not work for you?

-- DaveSlash
0
 
LVL 46

Accepted Solution

by:
Kent Olsen earned 1600 total points
ID: 21855277
Hi Tracy,

I'm with Dave on this one.

You can compute the difference in ASP, or have the value returned as the result of a SELECT statement.  From DB2, it's easy.  If you want days, try something like this:

  SELECT ts1, ts2, timestampdiff (16, char (ts2 - ts1))
  FROM sometable;

The first value (16) tells the function to return the number of days.

If one of the values is a date, you'll need to convert it to timestamp (datetime).  That's easy, though it can look a bit ugly.

If you want calendar days between two values convert them to DATE data types and use the DAYS function

  SELECT date (ts1), date (ts2), days (ts2) - days (ts1)
  FROM sometable;


Good Luck,
Kent


0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction ( All good things must come to an end ) The original MySQL API has gone away.  It was deprecated (years ago) by PHP in Version 5.5, and removed from PHP in all current releases .  As a result, the issue is upon us today.  It's time to …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question