Solved

TimeStamp difference

Posted on 2008-06-23
4
453 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:daveslash
daveslash earned 100 total points
ID: 21850971

So, did the TIMESTAMPDIFF function not work for you?

-- DaveSlash
0
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This video teaches users how to migrate an existing Wordpress website to a new domain.
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…

726 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