I am trying to write a program to store booking info for TV feeds. Most of the program is working fine, it stores all the info I need. One field is duration of feed which I am at the moment adding manually but it would be much nicer if I could get the program to do this automatically.
I am confused as how to process duration information which has to be returned in minutes.
I have a database with fields such as StartDate (which is set via the Calendar addon) StartHour & EndHour (Which are set by 2 separate combo boxes) & EndDate, EndHour & EndMinutes. I want it to return how many minutes have passed from the start date/time to the end date/time in another field called FeedDuration.
Ie Say have a booking starting from 1 Jan 08 @ 23:00 and ends on 02 Jan 08 @ 01:00. This is 120 minutes long and I need the field FeedDuration to be 120. How best should I go about coding this?
I am aware of the DateDiff function but not sure what syntax it is expecting. Is it expecting to see a string such as ’01-Jan-08 23:00’? Obviously my date/time info is in 3 seperate fields, I can add these together to create a legal string for the DateDiff function to use but not sure what it expects to see.
Many thanks for any help.