I came across the following syntax in a query
ORDER BY TEST.EMP_ID, IIf(IsNull([ETPSTARTDATE]),[DATE_HIRE],[ETPSTARTDATE]);
Appreciate if someone can explain to me how this works, with examples. I was unaware that you could do this.
Thanks heaps
sample data
ORDER BY TEST.EMP_ID, IIf(IsNull([ETPSTARTDATE]),[DATE_HIRE],[ETPSTARTDATE]);
Appreciate if someone can explain to me how this works, with examples. I was unaware that you could do this.
Thanks heaps
sample data
EMP_ID | DATE_HIRE | ETPSTARTDATE | EMP_STATUS |
21214 | 24/11/2008 | A1 | |
21216 | 24/11/2008 | A1 | |
21217 | 23/11/2008 | 23-Nov-08 | A1 |
21219 | 1/12/2008 | A1 | |
21226 | 9/02/2009 | A1 | |
21229 | 1/02/2009 | A1 | |
21230 | 23/02/2009 | A1 | |
21233 | 2/03/2009 | A1 | |
21235 | 2/03/2009 | A1 | |
21236 | 23/03/2009 | A1 | |
21239 | 14/04/2009 | A1 | |
21240 | 1/06/2009 | A1 | |
21245 | 9/06/2009 | A1 | |
21251 | 8/06/2009 | A1 | |
21253 | 5/10/2009 | A1 | |
21254 | 24/08/2009 | A1 | |
21255 | 24/08/2009 | A1 | |
21256 | 24/08/2009 | A1 | |
21257 | 7/09/2009 | A1 | |
21261 | 5/10/2009 | A1 | |
21262 | 12/10/2009 | A1 | |
21267 | 23/01/1984 | 23-Jan-84 | A1 |
21270 | 30/11/2009 | A1 |