Go Back   Access World Forums > Microsoft Access Discussion > Reports

Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
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

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looping through all fields and saving metadata Cowboy_BeBa Modules & VBA 1 03-01-2017 03:40 AM
Continous Forms - Looping through records & Manipulating Fields On Form LarryB Forms 15 05-29-2015 06:54 AM
Looping fields within a report chok120 Reports 5 06-28-2007 08:31 AM
looping through table fields bjackson Tables 1 10-14-2004 05:06 PM
looping through fields Mcgrco Modules & VBA 2 02-05-2003 10:15 AM

All times are GMT -8. The time now is 01:39 PM.

Microsoft Access Help
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post

Sponsored Links

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World