T
tkosel
I discovered something weird in one of my applications. To make a long story
short, an incorrect Julian date was being calculated. After much
scrutinization, it appeared that it was doing this becuase of the way I was
formatting the date. (dd/mm/yyyy versus mm/dd/yyyy) (The second to the last
example is where I discovered my mistake.)
I conducted the following experiment.
Use of Reversed (European Format) Month and Day Code (Correct Julian Date)
====================================================
Me.JulianExpirationDate = Format(DateAdd("yyyy", 5, Now()), "dd/mm/yyyy")
? me.JulianExpirationDate
30/04/2015
Me.JulianExpirationDate = Format([JulianExpirationDate], "yy") &
Format(Format_([JulianExpirationDate], "y"), "000")
? me.JulianExpirationDate
15120
Use of Non-Reversed Month and Day Code (Also Correct Julian Date)
==============================================
Me.JulianExpirationDate = DateAdd("yyyy", 5, Now())
? me.JulianExpirationDate
4/30/2015 12:38:15 PM
Me.JulianExpirationDate = Format(Me.JulianExpirationDate, "yy") &
Format(Format_(Me.JulianExpirationDate, "y"), "000")
? me.JulianExpirationDate
15120
Same as Above (European Format) with a Specific Date (Incorrect Julian Date)
===================================================
Me.JulianExpirationDate = Format(DateAdd("yyyy", 5, #02/08/2010#),
"dd/mm/yyyy")
? me.JulianExpirationDate
08/02/2015
Me.JulianExpirationDate = Format([JulianExpirationDate], "yy") &
Format(Format_([JulianExpirationDate], "y"), "000")
? me.JulianExpirationDate
15214
Same as Above (Non-Reversed Month and Day Code) with a Specific Date
(Correct Julian Date)
=====================================================
Me.JulianExpirationDate = DateAdd("yyyy", 5, #02/08/2010#)
? me.JulianExpirationDate
2/8/2015
Me.JulianExpirationDate = Format([JulianExpirationDate], "yy") &
Format(Format_([JulianExpirationDate], "y"), "000")
? me.JulianExpirationDate
15039
Can anyone tell me why the difference in the last two examples and why the
first two yeild the same results?
short, an incorrect Julian date was being calculated. After much
scrutinization, it appeared that it was doing this becuase of the way I was
formatting the date. (dd/mm/yyyy versus mm/dd/yyyy) (The second to the last
example is where I discovered my mistake.)
I conducted the following experiment.
Use of Reversed (European Format) Month and Day Code (Correct Julian Date)
====================================================
Me.JulianExpirationDate = Format(DateAdd("yyyy", 5, Now()), "dd/mm/yyyy")
? me.JulianExpirationDate
30/04/2015
Me.JulianExpirationDate = Format([JulianExpirationDate], "yy") &
Format(Format_([JulianExpirationDate], "y"), "000")
? me.JulianExpirationDate
15120
Use of Non-Reversed Month and Day Code (Also Correct Julian Date)
==============================================
Me.JulianExpirationDate = DateAdd("yyyy", 5, Now())
? me.JulianExpirationDate
4/30/2015 12:38:15 PM
Me.JulianExpirationDate = Format(Me.JulianExpirationDate, "yy") &
Format(Format_(Me.JulianExpirationDate, "y"), "000")
? me.JulianExpirationDate
15120
Same as Above (European Format) with a Specific Date (Incorrect Julian Date)
===================================================
Me.JulianExpirationDate = Format(DateAdd("yyyy", 5, #02/08/2010#),
"dd/mm/yyyy")
? me.JulianExpirationDate
08/02/2015
Me.JulianExpirationDate = Format([JulianExpirationDate], "yy") &
Format(Format_([JulianExpirationDate], "y"), "000")
? me.JulianExpirationDate
15214
Same as Above (Non-Reversed Month and Day Code) with a Specific Date
(Correct Julian Date)
=====================================================
Me.JulianExpirationDate = DateAdd("yyyy", 5, #02/08/2010#)
? me.JulianExpirationDate
2/8/2015
Me.JulianExpirationDate = Format([JulianExpirationDate], "yy") &
Format(Format_([JulianExpirationDate], "y"), "000")
? me.JulianExpirationDate
15039
Can anyone tell me why the difference in the last two examples and why the
first two yeild the same results?