A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

90 days and the first of the month



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2010, 09:33 PM posted to microsoft.public.access.queries
Gaetan via AccessMonster.com
external usenet poster
 
Posts: 3
Default 90 days and the first of the month

I'm trying to figure out hoe to calculate 90 days from hire and the first
of the month

Example:

HiredDate Insurance activated

1/3/2010 4/1/2010 That is 90 days and the
following 1st of the month

Exception to the Rule:

1/1/2010 3/1/2010 If hired on the first its just
HiredDate +90


All I came up with for my query is

INSsurance: DateAdd("m",3,[DateHired]-Day([DateHired])+1)

Any assistance wiuld greatly be appreciated

Thanks


G

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1

  #2  
Old May 19th, 2010, 02:21 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 90 days and the first of the month

On Tue, 18 May 2010 20:33:47 GMT, "Gaetan via AccessMonster.com" u49408@uwe
wrote:

I'm trying to figure out hoe to calculate 90 days from hire and the first
of the month

Example:

HiredDate Insurance activated

1/3/2010 4/1/2010 That is 90 days and the
following 1st of the month

Exception to the Rule:

1/1/2010 3/1/2010 If hired on the first its just
HiredDate +90


All I came up with for my query is

INSsurance: DateAdd("m",3,[DateHired]-Day([DateHired])+1)

Any assistance wiuld greatly be appreciated

Thanks


G


Try

DateSerial(Year([HiredDate]), Month([HiredDate])+IIF(Day([HiredDate]=1,3,4),1)

This will get *three months* which is not necessarily equal to 90 days.
--

John W. Vinson [MVP]
  #3  
Old May 19th, 2010, 03:28 PM posted to microsoft.public.access.queries
Gaetan via AccessMonster.com
external usenet poster
 
Posts: 3
Default 90 days and the first of the month

Thanks for the reply

I'm getting an error message on the following query.

90days from hireateSerial(Year([HiredDate]), Month([HiredDate])+IIF(Day(
[HiredDate]=1,3,4),1)

The error message is: The expression you have enterd has a function
containing the wrong
number of arguments.

Any Ideas

Gaetan

John W. Vinson wrote:
I'm trying to figure out hoe to calculate 90 days from hire and the first
of the month

[quoted text clipped - 20 lines]

G


Try

DateSerial(Year([HiredDate]), Month([HiredDate])+IIF(Day([HiredDate]=1,3,4),1)

This will get *three months* which is not necessarily equal to 90 days.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1

  #4  
Old May 19th, 2010, 09:03 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default 90 days and the first of the month

Missing a closing parenthesis in the Day(HiredDate) call

DateSerial(Year([HiredDate]), Month([HiredDate])+
IIF(Day([HiredDate])=1,3,4),1)


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Gaetan via AccessMonster.com wrote:
Thanks for the reply

I'm getting an error message on the following query.

90days from hireateSerial(Year([HiredDate]), Month([HiredDate])+IIF(Day(
[HiredDate]=1,3,4),1)

The error message is: The expression you have enterd has a function
containing the wrong
number of arguments.

Any Ideas

Gaetan

John W. Vinson wrote:
I'm trying to figure out hoe to calculate 90 days from hire and the first
of the month

[quoted text clipped - 20 lines]
G

Try

DateSerial(Year([HiredDate]), Month([HiredDate])+IIF(Day([HiredDate]=1,3,4),1)

This will get *three months* which is not necessarily equal to 90 days.


  #5  
Old May 20th, 2010, 05:04 PM posted to microsoft.public.access.queries
Gaetan via AccessMonster.com
external usenet poster
 
Posts: 3
Default 90 days and the first of the month

John

Thanks That worked Great!!

John Spencer wrote:
Missing a closing parenthesis in the Day(HiredDate) call

DateSerial(Year([HiredDate]), Month([HiredDate])+
IIF(Day([HiredDate])=1,3,4),1)

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Thanks for the reply

[quoted text clipped - 20 lines]

This will get *three months* which is not necessarily equal to 90 days.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/201005/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.