Has anyone ever used an IIF statement in a SELECT query, where an alias name is used to generate an alternative value from the original table data?
eg.
SELECT xid, xname,
IIf(DateValue(Format([xDate],"dd/mm/yyyy"
)=Null,"",DateValue(Format([xDate],"dd/mm/yyyy"
)) AS LastDate
FROM xTable;
xDate in table xTable is stored in the general Date format ie. dd/MM/yyyy hh:mm:ss AMPM
I've used something similar with strings, but not with the IIF statement.
thanks
eg.
SELECT xid, xname,
IIf(DateValue(Format([xDate],"dd/mm/yyyy"
FROM xTable;
xDate in table xTable is stored in the general Date format ie. dd/MM/yyyy hh:mm:ss AMPM
I've used something similar with strings, but not with the IIF statement.
thanks