Query on Date field

  • Thread starter Thread starter tonyflath
  • Start date Start date
T

tonyflath

Guest
I am trying to use an IIf statement to insert a date entry into fields on a query that are null. Included is the statement I am trying to use.

IIf([Date1] Is Null,[Date1]=#2222/02/02#,[Date1])

What happens when I run the query is that fields with null values result in the entire record being dropped. Any help is appreciated.

Thanks,
Tony
 
If [Date1] is a field in the table you need to use UPDATE query not INSERT. Then no need to use IIF.
UPDATE myTable SET myTable.Date1 = #mm/dd/yy#
WHERE (((myTable.Date1) Is Null));

Example :
UPDATE myTable SET myTable.Date1 = #2/2/01#
WHERE (((myTable.Date1) Is Null));

If you are using a form to enter the records into teh tabel then you need to use before insert event proc.



[This message has been edited by araskas (edited 11-15-2001).]
 

Users who are viewing this thread

Back
Top Bottom