Formatting DATE fields within lists
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Formatting DATE fields within lists

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
Mr Frustrated
Guest





Posted: Fri Nov 11, 2005 1:51 pm    Post subject: Formatting DATE fields within lists Reply with quote

This should be simple......but here goes.

I have a list with a date field imaginatively called DATE. I want to display
the list grouped by year. I have tried to use a calculated field and the
formula "=YEAR([DATE]), then group on the calculated field. This sort of
works in that it does what I want, however the formatting of the year is in
standard numeric format and displays 2005 as 2,005.

I've tried everything I can think of in terms of FORMAT(YEAR........),
DATEFORMAT(............), CONVERT(.........), etc, and none seems to work. If
anybody has any ideas, I'd be very happy as my laptop is about to go sailing
out of the fifth floor window!

Cheers.
Back to top
Engelbert
Guest





Posted: Fri Nov 11, 2005 1:51 pm    Post subject: Re: Formatting DATE fields within lists Reply with quote

Faced with the same problem, I just created a new field "imaginatively"
called Year and made it compulsary (and default this year written as 2005)
so that every time anything was added it got the default. For old records I
added the content in bulk using Datasheet View.

(Just had to remember to change the default once a year ...)

Engelbert

"Mr Frustrated" <Mr Frustrated@discussions.microsoft.com> wrote in message
news:C840052B-451A-4848-B23A-0BCB9C56D667@microsoft.com...
Quote:
This should be simple......but here goes.

I have a list with a date field imaginatively called DATE. I want to
display
the list grouped by year. I have tried to use a calculated field and the
formula "=YEAR([DATE]), then group on the calculated field. This sort of
works in that it does what I want, however the formatting of the year is
in
standard numeric format and displays 2005 as 2,005.

I've tried everything I can think of in terms of FORMAT(YEAR........),
DATEFORMAT(............), CONVERT(.........), etc, and none seems to work.
If
anybody has any ideas, I'd be very happy as my laptop is about to go
sailing
out of the fifth floor window!

Cheers.
Back to top
Mr Frustrated
Guest





Posted: Fri Nov 11, 2005 1:51 pm    Post subject: Re: Formatting DATE fields within lists Reply with quote

Thanks for that Englebert.

I thought about doing it that way myself, but unfortuantely the dates that
are going to be entered are not necessarily the current year. They could be
last year, this year, next year, etc; therefore a more dynamic solution would
be preferrable.



"Engelbert" wrote:

Quote:
Faced with the same problem, I just created a new field "imaginatively"
called Year and made it compulsary (and default this year written as 2005)
so that every time anything was added it got the default. For old records I
added the content in bulk using Datasheet View.

(Just had to remember to change the default once a year ...)

Engelbert

"Mr Frustrated" <Mr Frustrated@discussions.microsoft.com> wrote in message
news:C840052B-451A-4848-B23A-0BCB9C56D667@microsoft.com...
This should be simple......but here goes.

I have a list with a date field imaginatively called DATE. I want to
display
the list grouped by year. I have tried to use a calculated field and the
formula "=YEAR([DATE]), then group on the calculated field. This sort of
works in that it does what I want, however the formatting of the year is
in
standard numeric format and displays 2005 as 2,005.

I've tried everything I can think of in terms of FORMAT(YEAR........),
DATEFORMAT(............), CONVERT(.........), etc, and none seems to work.
If
anybody has any ideas, I'd be very happy as my laptop is about to go
sailing
out of the fifth floor window!

Cheers.


Back to top
Engelbert
Guest





Posted: Fri Nov 11, 2005 1:51 pm    Post subject: Re: Formatting DATE fields within lists Reply with quote

The minor amendment is to have the field a Choice field so they at least
have the drop-down of years to select from.

Yes, I know there must be a better way ...

Let's wait for someone to come in the thread with it.

Engelbert

"Mr Frustrated" <MrFrustrated@discussions.microsoft.com> wrote in message
news:23752A0E-25DA-40B2-ADF8-D53A1B4B0ECD@microsoft.com...
Quote:
Thanks for that Englebert.

I thought about doing it that way myself, but unfortuantely the dates that
are going to be entered are not necessarily the current year. They could
be
last year, this year, next year, etc; therefore a more dynamic solution
would
be preferrable.



"Engelbert" wrote:

Faced with the same problem, I just created a new field "imaginatively"
called Year and made it compulsary (and default this year written as
2005)
so that every time anything was added it got the default. For old records
I
added the content in bulk using Datasheet View.

(Just had to remember to change the default once a year ...)

Engelbert

"Mr Frustrated" <Mr Frustrated@discussions.microsoft.com> wrote in
message
news:C840052B-451A-4848-B23A-0BCB9C56D667@microsoft.com...
This should be simple......but here goes.

I have a list with a date field imaginatively called DATE. I want to
display
the list grouped by year. I have tried to use a calculated field and
the
formula "=YEAR([DATE]), then group on the calculated field. This sort
of
works in that it does what I want, however the formatting of the year
is
in
standard numeric format and displays 2005 as 2,005.

I've tried everything I can think of in terms of FORMAT(YEAR........),
DATEFORMAT(............), CONVERT(.........), etc, and none seems to
work.
If
anybody has any ideas, I'd be very happy as my laptop is about to go
sailing
out of the fifth floor window!

Cheers.


Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB