6. Code Breakdown
Below are all the code used to make my custom date field. It is written in a way for easy reading. At least to me.
Date: Released (Day)
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Right([Date: Released],2),00,0)
,
,
If(
IsRange(Right([Date: Released],2),1-9)
,
Right([Date: Released],1)
,
If(
IsRange(Right([Date: Released],2),10-31)
,
Right([Date: Released],2)
,
<ERROR: DAY>
)
)
)
)
Date: Released (Month)
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Mid([Date: Released],5,2),00,0)
,
If(
IsEqual(Right([Date: Released],2),Mid([Date: Released],5,2),0)
,
,
<ERROR: DAY>
)
,
If(
IsRange(Mid([Date: Released],5,2),1-12)
,
If(IsEqual(Mid([Date: Released],5,2),01,0),January,)
If(IsEqual(Mid([Date: Released],5,2),02,0),February,)
If(IsEqual(Mid([Date: Released],5,2),03,0),March,)
If(IsEqual(Mid([Date: Released],5,2),04,0),April,)
If(IsEqual(Mid([Date: Released],5,2),05,0),May,)
If(IsEqual(Mid([Date: Released],5,2),06,0),June,)
If(IsEqual(Mid([Date: Released],5,2),07,0),July,)
If(IsEqual(Mid([Date: Released],5,2),08,0),August,)
If(IsEqual(Mid([Date: Released],5,2),09,0),September,)
If(IsEqual(Mid([Date: Released],5,2),10,0),October,)
If(IsEqual(Mid([Date: Released],5,2),11,0),November,)
If(IsEqual(Mid([Date: Released],5,2),12,0),December,)
,
<ERROR: MONTH>
)
)
)
Date: Released (Month #)
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Mid([Date: Released],5,2),00,0)
,
If(
IsEqual(Right([Date: Released],2),Mid([Date: Released],5,2),0)
,
,
<ERROR: DAY>
)
,
If(
IsRange(Mid([Date: Released],5,2),1-9)
,
Mid([Date: Released],6,1)
,
If(
IsRange(Mid([Date: Released],5,2),10-12)
,
Mid([Date: Released],5,2)
,
<ERROR: MONTH>
)
)
)
)
Date: Released (Year)
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Left([Date: Released],4),0000,0)
,
If(
IsEqual(Left([Date: Released],4),Mid([Date: Released],5,2)00,0)
,
,
<ERROR: MONTH>
)
,
If(
IsRange(Left([Date: Released],4),1-9)
,
Mid([Date: Released],3,1)
,
If(
IsRange(Left([Date: Released],4),10-99)
,
Mid([Date: Released],2,2)
,
If(
IsRange(Left([Date: Released],4),100-999)
,
Mid([Date: Released],1,3)
,
If(
IsRange(Left([Date: Released],4),1000-2099)
,
Left([Date: Released],4)
,
<ERROR: YEAR>
)
)
)
)
)
)
Date: Released (Display)
9/5/2010
If(
IsEmpty([Date: Released])
,
,
If(
I sEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
If(IsEmpty([Date: Released (Month #)]),,[Date: Released (Month #)]//)
If(IsEmpty([Date: Released (Day)]),,[Date: Released (Day)]//)
[Date: Released (Year)]
,
<ERROR: DATE>
)
)
2010/9/5
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
[Date: Released (Year)]
If(IsEmpty([Date: Released (Month #)]),,//[Date: Released (Month #)])
If(IsEmpty([Date: Released (Day)]),,//[Date: Released (Day)])
,
<ERROR: DATE>
)
)
2010-9-5
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
[Date: Released (Year)]
If(IsEmpty([Date: Released (Month #)]),,-[Date: Released (Month #)])
If(IsEmpty([Date: Released (Day)]),,-[Date: Released (Day)])
,
<ERROR: DATE>
)
)
9-5-2010
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
If(IsEmpty([Date: Released (Month #)]),,[Date: Released (Month #)]-)
If(IsEmpty([Date: Released (Day)]),,[Date: Released (Day)]-)
[Date: Released (Year)]
,
<ERROR: DATE>
)
)
5 September 2010
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
If(IsEmpty([Date: Released (Day)]),,[Date: Released (Day)] )
If(IsEmpty([Date: Released (Month)]),,[Date: Released (Month)] )
[Date: Released (Year)]
,
<ERROR: DATE>
)
)
5 Sep 2010
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
If(IsEmpty([Date: Released (Day)]),,[Date: Released (Day)] )
If(IsEmpty([Date: Released (Month)]),,Left([Date: Released (Month)],3) )
[Date: Released (Year)]
,
<ERROR: DATE>
)
)
September 5, 2010
If(
IsEmpty([Date: Released])
,
,
If(IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
If(IsEmpty([Date: Released (Month)]),,[Date: Released (Month)] )
If(IsEmpty([Date: Released (Day)]),,[Date: Released (Day)]/, )
[Date: Released (Year)]
,
<ERROR: DATE>
)
)
Sep 5, 2010
If(
IsEmpty([Date: Released])
,
,
If(
IsEqual(Length([Date: Released])Mid([Date: Released],4,1)Mid([Date: Released],7,1),10--,0)
,
If(IsEmpty([Date: Released (Month)]),,Left([Date: Released (Month)],3) )
If(IsEmpty([Date: Released (Day)]),,[Date: Released (Day)]/, )
[Date: Released (Year)]
,
<ERROR: DATE>
)
)