From: Charno on 5 May 2010 05:33 I have a table/form which i have 2 columns/fields which time is entered. "DRSR Time" and "Gate Time". What i'm trying to do is return the value 'Hit' (if the difference between the 2 times is less than 60 mins) or 'Miss' (if it is greater than 60 mins), in a 3rd column/field called "adhearance". Any help would be great, Thanks
From: Stefan Hoffmann on 5 May 2010 05:43 hi Charno, On 05.05.2010 11:33, Charno wrote: > I have a table/form which i have 2 columns/fields which time is entered. > "DRSR Time" and "Gate Time". > What i'm trying to do is return the value 'Hit' (if the difference between > the 2 times is less than 60 mins) or 'Miss' (if it is greater than 60 mins), > in a 3rd column/field called "adhearance". Use DateDiff() in a query to calculate this value when needed: IIf(DateDiff("n", [DRSR Time], [Gate Time]) > 60, "Miss", "Hit") E.g.: http://www.techonthenet.com/access/functions/date/datediff.php mfG --> stefan <--
From: RonaldoOneNil on 5 May 2010 06:12 Set the control source property of your adhearance field to =IIf(DateDiff("n",[DRSR Time],[Gate Time])<=60,"Hit","Miss") "Charno" wrote: > I have a table/form which i have 2 columns/fields which time is entered. > "DRSR Time" and "Gate Time". > What i'm trying to do is return the value 'Hit' (if the difference between > the 2 times is less than 60 mins) or 'Miss' (if it is greater than 60 mins), > in a 3rd column/field called "adhearance". > > Any help would be great, > > Thanks > > >
From: Charno on 5 May 2010 06:24 I know its a bit of an Access sin, but could the value be returned to the table? "RonaldoOneNil" wrote: > Set the control source property of your adhearance field to > =IIf(DateDiff("n",[DRSR Time],[Gate Time])<=60,"Hit","Miss") > > "Charno" wrote: > > > I have a table/form which i have 2 columns/fields which time is entered. > > "DRSR Time" and "Gate Time". > > What i'm trying to do is return the value 'Hit' (if the difference between > > the 2 times is less than 60 mins) or 'Miss' (if it is greater than 60 mins), > > in a 3rd column/field called "adhearance". > > > > Any help would be great, > > > > Thanks > > > > > >
From: Stefan Hoffmann on 5 May 2010 07:11
hi Charno, On 05.05.2010 12:24, Charno wrote: > I know its a bit of an Access sin, but could the value be returned to the > table? Yes, but this makes would allow you to get inconsistent data. Consider that you have entered time date, inserted this miss/hit flag and the changed the time data without recalculating it. Thus you normally use this kind of calculation either in query or in a field directly. So you don't need to store it. mfG --> stefan <-- |