COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Sort - Month then day without year

• Email
• Follow

```How's about "Sort"  Month / Day  without year in birthday date field?

Daniel R. Sloan

```
 0

See related articles to this posting

```
"Daniel R. Sloan" wrote:
>
> How's about "Sort"  Month / Day  without year in birthday date field?

Two calcs based on the full date field of format xx/xx/xxxx

Day: Left (DateField, 2)
Month: Middle (DateField, 4, 2)

Then sort on those in order

Cheers

Webko
```
 0

```In article <jlKTa.131701\$N7.19170@sccrnsc03>,
"Daniel R. Sloan" <danielsloan@comcast.net> wrote:

> How's about "Sort"  Month / Day  without year in birthday date field?

If the field is actually a date type then you could have a calculated
field of:

(month(bdate) * 100) + day(dbate)

This will give you numbers like:

131 - for Jan 31
1202 - for Dec 2

You can then sort on this calculated field.

--
Matthew Smith
(to reply via email remove xxx)
```
 0

```[posted and mailed]

"Daniel R. Sloan" <danielsloan@comcast.net> wrote in news:jlKTa.131701
\$N7.19170@sccrnsc03:

> How's about "Sort"  Month / Day  without year in birthday date field?
>
> Daniel R. Sloan
>
>
>

I know this may be a little late but . .

I found the easiest way is to sort by month and date sans the year is to
use the following calculated field -

zc.SortDate(text): If( Month( Date )  < 10 , "0" ,"" ) & Month( Date ) &
"." & If( Day( Date ) < 10 , "0" ,"" )  & Day( Date )

you end up with a calculated result like 03.12 for a date of 3/12/2001 and
it should sort just fine.

```
 0