Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

if or and expression

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RA@UIC - 21 Feb 2008 22:35 GMT
Hi All,
  I'm still learning the ropes of Access as a relatively new user. Could
someone help me with writing an expression for an "if or and" function in
conjunction with a calculating a future date function?

E.g., If week 1 displays null, then enter this date in the future using this
formula. If week 1 has a date entered, then apply formula towards
it...perhaps this is sort of vague, and I apologize. This is what I have so
far, but can't get it to work:

=IIf(IsNull([Date 2nd Pre-Intervention Scheduled]), DateSerial(Year([Date
Pre-Intervention Scheduled]),Month([Date Pre-Intervention
Scheduled]),Day([Date Pre-Intervention Scheduled])+42)

Many thanks in advance
Klatuu - 22 Feb 2008 00:40 GMT
That will not work at all.  You are trying to do a DateSerial function on a
Null value.  And, the DateSerial will not return what you think it will and
is not really the correct function for this.

What do you mean by "If week 1 displays null, then enter this date in the
future"?
What is "this date".

If your field is Null and you want to replace it with a date 42 days from
the current date, I would do it this way:

=Nz([Date 2nd Pre-Intervention Scheduled], DateAdd("d", 42, [Date 2nd
Pre-Intervention Scheduled]))

Signature

Dave Hargis, Microsoft Access MVP

> Hi All,
>    I'm still learning the ropes of Access as a relatively new user. Could
[quoted text clipped - 11 lines]
>
> Many thanks in advance
RA@UIC - 23 Feb 2008 23:06 GMT
This function would concern 3 fields. "Pre-assessment 1 Date - Immediate
starts", "Pre-assessment 2 Date - Control Starts", and "Date of Week 7
Post-Assessments".

The function I was attempting to create would do the following:

If the "Pre-assessment 2 Date - Control Starts" field DOES NOT have a date
entered in, then "Date of Week 7 Post-Assessments" would equal a date 7 weeks
later from the date listed in "Pre-assessment 1 Date - Immediate starts".

Or

If "Pre-assessment 2 Date - Control Starts" DOES have a date, I would like
"Date of Week 7 Post-Assessments" to equal 7 weeks later from the date listed
in "Pre-assessment 2 Date - Control Starts".

I'm assuming this function would be embedded within the "Date of Week 7
Post-Assessments" field

Thanks for your response, and again, for any insight you can offer.

Many thanks,
Dan

> That will not work at all.  You are trying to do a DateSerial function on a
> Null value.  And, the DateSerial will not return what you think it will and
[quoted text clipped - 25 lines]
> >
> > Many thanks in advance
RA@UIC - 23 Feb 2008 23:07 GMT
This function would concern 3 fields: "Pre-assessment 1 Date - Immediate
starts", "Pre-assessment 2 Date - Control Starts", and "Date of Week 7
Post-Assessments"

The function I was attempting to create would do the following:

If the "Pre-assessment 2 Date - Control Starts" field DOES NOT have a date
entered in, then "Date of Week 7 Post-Assessments" would equal a date 7 weeks
later from the date listed in "Pre-assessment 1 Date - Immediate starts".

Or

If "Pre-assessment 2 Date - Control Starts" DOES have a date, I would like
"Date of Week 7 Post-Assessments" to equal 7 weeks later from the date listed
in "Pre-assessment 2 Date - Control Starts".

I'm assuming this function would be embedded within the "Date of Week 7
Post-Assessments" field

Thanks for your response, and again, for any insight you can offer.

Many thanks,
Dan

> That will not work at all.  You are trying to do a DateSerial function on a
> Null value.  And, the DateSerial will not return what you think it will and
[quoted text clipped - 25 lines]
> >
> > Many thanks in advance
Klatuu - 25 Feb 2008 14:16 GMT
DateAdd("ww",7, Nz([Pre-assessment 2 Date - Control Starts], [Pre-assessment
1 Date - Immediate starts]))

Signature

Dave Hargis, Microsoft Access MVP

> This function would concern 3 fields: "Pre-assessment 1 Date - Immediate
> starts", "Pre-assessment 2 Date - Control Starts", and "Date of Week 7
[quoted text clipped - 49 lines]
> > >
> > > Many thanks in advance
RA@UIC - 25 Feb 2008 14:23 GMT
Thank you so much!

> DateAdd("ww",7, Nz([Pre-assessment 2 Date - Control Starts], [Pre-assessment
> 1 Date - Immediate starts]))
[quoted text clipped - 52 lines]
> > > >
> > > > Many thanks in advance
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.