fiscal year transition

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If [DateField] < 10/1/2007 Then
[FiscalYear] = 2007

If [DateField] >= 10/1/2007 Then
[FiscalYear] = 2008

So am wrestling with the form code being year independent, which is to say I
can NOT hard code in If [DateField] < 10/1/2007 because that would only
work for this year....need it to be generic...

If [mm/dd/yyyy] < 10/1/yyyy Then
[FiscalYear] = yyyy

If [DateField] >= 10/1/yyyy Then
[FiscalYear] = (yyyy + 1)

so it will work year after year - - need to take the DateField's year...and
plug it onto the fixed 10/1/____ and then do the compare

still struggle with date manipulation and would greatly welcome
assist....thnks...NTC
 
NetworkTrade said:
If [DateField] < 10/1/2007 Then
[FiscalYear] = 2007

If [DateField] >= 10/1/2007 Then
[FiscalYear] = 2008

So am wrestling with the form code being year independent, which is to say
I
can NOT hard code in If [DateField] < 10/1/2007 because that would only
work for this year....need it to be generic...


If Month([DateField]) < 10 Then
[FiscalYear] = Year([DateField])
Else
[FiscalYear] = Year([DateField]) + 1
End If

Tom Lake
 
thanks - after I wrote the question I figured out an answer differently
using a new unbound text box CompareDate =DateSerial(Year([DateField]),10,1)

and then did the compare off those two....but your code is more efficient so
am going to plug it in and try it....tnks again....
--
NTC


Tom Lake said:
NetworkTrade said:
If [DateField] < 10/1/2007 Then
[FiscalYear] = 2007

If [DateField] >= 10/1/2007 Then
[FiscalYear] = 2008

So am wrestling with the form code being year independent, which is to say
I
can NOT hard code in If [DateField] < 10/1/2007 because that would only
work for this year....need it to be generic...


If Month([DateField]) < 10 Then
[FiscalYear] = Year([DateField])
Else
[FiscalYear] = Year([DateField]) + 1
End If

Tom Lake
 
Back
Top