From: Chuck W on 6 May 2010 09:13 Hi, I have a table called tblReadmits that has AdmitDate, DischargeDate and AdmitDate2 as date fields. I created a query with a calculated field called ReadmitDays which is AdmitDate2 - DischargeDate. I only want a value to show in this field though if it is between 0 and 30. Otherwise, I want it to be null. Can someone help with an SQL statement which will do this? Thanks,
From: John Spencer on 6 May 2010 09:36 IIF(AdmitDate2-DischargeDate Between 0 and 30, AdmitDate2-DischargeDate,Null) John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Chuck W wrote: > Hi, > I have a table called tblReadmits that has AdmitDate, DischargeDate and > AdmitDate2 as date fields. I created a query with a calculated field called > ReadmitDays which is AdmitDate2 - DischargeDate. I only want a value to show > in this field though if it is between 0 and 30. Otherwise, I want it to be > null. Can someone help with an SQL statement which will do this? > > Thanks,
|
Pages: 1 Prev: validation rule (for a record in a table) with dlookup Next: Sub report formatting |