View Single Post
Old 10-14-2019, 12:40 PM   #1
Newly Registered User
Join Date: Oct 2019
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
ClaraBarton is on a distinguished road
Looping through fields by type

I have a database with many Date/Time fields. Oftentimes we don't have an exact date (geneology) but an approximation so we fill the field with 1/1/1861. I would like to loop through all fields of Date/Time type and do the following:
IIf(DatePart("m",[MINISTER])=1 And DatePart("d",[MINISTER])=1,Format([MINISTER],"yyyy"),[MINISTER])
In other words, if the field has a month of 1 and a day of 1, change the format to year only in the report. This formula works in a query on each field but I wondered if there's a better way.

ClaraBarton is offline   Reply With Quote