Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form date field showing the start of the previous Quarter

Status
Not open for further replies.

PWD

Technical User
Jul 12, 2002
823
0
0
GB
Good morning, I have inherited an Access database that has a form containing a field that has to show the start date of the previous quarter - in this case that would be 1st October 2014. I was trying to understand the Default Value text as it came up showing 2nd October. I amended it as below and it now shows "01/10/2014", so I'm pretty happy about that, but I'd really like to understand what's going on if anyone could spare the time to explain.

=DateAdd("m",-3,(DateSerial(Year(Date()),3*Int(((Month(Date()))-1)/3)+1,1)-1))+1

Many thanks,
D€$
 
Doesn't this simpler formula suffice ?
=DateAdd("m",-3,DateSerial(Year(Date()),3*Int(((Month(Date()))-1)/3)+1,1))

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi, yes that worked perfectly well.

This also appears to do the job

=DateAdd("m",-3,DateSerial(Year(Date()),Int(Month(Date()))-1,1))

I can't really see the point of multiplying and dividing the 'Int' result either.

Many thanks,
D€$
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top