How to alter an update query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I have an update query which calculates the current age for cows. It is
DateDiff("m",[Date of Birth],Now()). However i want it so when another field
called Date of Movement has a date entered i want the current age field which
is automatically updated to have 0 automatically entered if there is
something in the date of movement field.
 
iif([Date of Movement] is null, DateDiff("m",[Date of Birth],Now()),
0)

Cheers,
Jason Lepack
 
Thomas Woof said:
Hi
I have an update query which calculates the current age for cows. It is
DateDiff("m",[Date of Birth],Now()). However i want it so when another
field
called Date of Movement has a date entered i want the current age field
which
is automatically updated to have 0 automatically entered if there is
something in the date of movement field.

You're not storing the age of the cow in a table are you? That's a no-no.

Tom Lake
 
Back
Top