This topic is locked

date/time difference

7/16/2012 6:59:19 AM
ASPRunnerPro General questions
P
pugsley92 author

Hi all,
I'm doing a project to my enterprise, and I have to fields with date/time, but they have a mask 99/99/9999 99:99 and in my DB the field are as 'text', cause in another way the date/time doesn't apear. I also have a regular expression in both fields
\b(0?[1-9]|[12][0-9]|3[01])// (([0-1][0-9])|([2][0-3]))<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=19852&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />([0-9])|([0-5][0-9]))$
I would like to know if there are any way to have the time difference between the end_time and initial_time, having that regular expression and the field as 'text'

Sergey Kornilov admin 7/17/2012

The best approach is to use datetime fields in the database. This way you can use database functions like datediff() in your SQL query to calculate date and time difference.