?
Solved

TimeStamp difference

Posted on 2008-06-23
4
Medium Priority
?
455 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
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…

765 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