![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I'm am trying to create a custom date string where a date exists for my field: [LastDistrictImportDate]. My date format alone works fine, but when I put it in the IIF statement, I get an #Error. Where no date exists, the IIF statement is evaluating fine (to ""). Even if there's a better way to do this, I'd like to know what's wrong with what I've got... Doesn't Work (where date exists): Last Import Date: IIf([LastDistrictImportDate]>"",(Right("0" & Month([LastDistrictImportDate]),2) & "/" & Day([LastDistrictImportDate]) & "/" & Year([LastDistrictImportDate])),"") Just the custom datepart works fine: aFormattedDate: Right("0" & Month([LastDistrictImportDate]),2) & "/" & Day([LastDistrictImportDate]) & "/" & Year([LastDistrictImportDate]) |
#3
| |||
| |||
|
|
On Friday, July 27, 2012 1:00:50 PM UTC-4, Chris wrote: Hi all, I'm am trying to create a custom date string where a date exists for my field: [LastDistrictImportDate]. My date format alone works fine, but when I put it in the IIF statement, I get an #Error. Where no date exists, the IIF statement is evaluating fine (to ""). Even if there's a better way to do this, I'd like to know what's wrong with what I've got... Doesn't Work (where date exists): Last Import Date: IIf([LastDistrictImportDate]>"",(Right("0" & Month([LastDistrictImportDate]),2) & "/" & Day([LastDistrictImportDate]) & "/" & Year([LastDistrictImportDate])),"") Just the custom date part works fine: aFormattedDate: Right("0" & Month([LastDistrictImportDate]),2) & "/" & Day([LastDistrictImportDate]) & "/" & Year([LastDistrictImportDate]) OK, figured out my own fix. Changed if clause to: nz([LastDistrictImportDate],"") <> "". Not sure why it's a fix, probably has to do with data type. |
![]() |
| Thread Tools | |
| Display Modes | |
| |