This topic is locked

Date Calculation

11/1/2007 5:44:16 PM
ASPRunnerPro General questions
K
KingDean author

I would like to have a field that shows the length of time between to date/time fields in MYSql, asprunner 5.1. Any ideas?

D
dlangham 11/1/2007

You could use

DATEDIFF('d',yourstartdatefield,yourenddatefield)

in your sql query, this is for calculating days between 2 dates.

K
KingDean author 11/2/2007

DATEDIFF('d',yourstartdatefield,yourenddatefield)
Do i place this in mysql on the field there or in asprunner?

D
dlangham 11/2/2007

You can place it in either, but you will have to name the field, something along the lines of:

DATEDIFF('d',yourstartdatefield,yourenddatefield) as [Calculated_Dates]


"yourstartdatefield" and "yourenddatefield" would be your start and end date fields as named in your db.

D
dunga 5/22/2008

thank you Dale, it was perfect.