INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to use: FormatDate() ?  (Read 2308 times)

sbsp2

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 402
How to use: FormatDate() ?
« on: November 01, 2006, 05:23:54 pm »

I've tried to use the FormatDate() function to 'format' the Year (on MP3s) and it appears to not work in this instance.  I want MP3s that don't have the year tagged to show 0000 instead of blanks (nothing) (in a user-defined column).

I tried many varieties of FormatDate() syntax, but it always outputted 0000.

FormatDate([Year, 0], Year, 0000)
FormatDate([Date, 0], Year, 0000)
FormatDate(Year, Year, 0000)
FormatDate([Year], YYYY, 0000)
and about 10 other varities w/no success.

Any clues?  Is this an MC12 bug?
Logged

gappie

  • Guest
Re: How to use: FormatDate() ?
« Reply #1 on: November 01, 2006, 05:30:25 pm »

would this help?
If(IsEmpty([Year]),0000,[year])
Logged

sbsp2

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 402
Re: How to use: FormatDate() ?
« Reply #2 on: November 01, 2006, 05:45:56 pm »

Probably, thanks!!

I thought about using that style, but figured I'd use FormatDate() since it is documented that what I'm trying should work (bug, I guess it does not).
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9133
Re: How to use: FormatDate() ?
« Reply #3 on: November 01, 2006, 05:56:31 pm »

for files with no date you need the conditional expression given by gappie above.

formatdate() is used to to display existing [date] data in ways other than the default, such as if(isempty([year]),0000,'formatdate([date,0],yy))

sbsp2

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 402
Re: How to use: FormatDate() ?
« Reply #4 on: November 01, 2006, 06:14:40 pm »

for files with no date you need the conditional expression given by gappie above.

formatdate() is used to to display existing [date] data in ways other than the default, such as if(isempty([year]),0000,'formatdate([date,0],yy))

But, there's a 3rd parameter on FormatDate().  What's that for? (please, see the documenation in Dev area)
Logged

gappie

  • Guest
Re: How to use: FormatDate() ?
« Reply #5 on: November 01, 2006, 06:45:15 pm »

But, there's a 3rd parameter on FormatDate().  What's that for? (please, see the documenation in Dev area)

yeah. i just tried to put that third conditional in the format date that i use somewere. and indeed it does not work
FormatDate([Last Played,0],d-MMM-yyyy) gives a date when there is one.

edited like the example in the dev zone
FormatDate([Last Played,0],d-MMM-yyyy, no date) gives Žno dateŽ everywere.

but then again. you dont want to use format the date when using [year]. i expect it is not even a date format so format date would not work, i guess.
Logged

sbsp2

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 402
Re: How to use: FormatDate() ?
« Reply #6 on: November 01, 2006, 08:25:48 pm »

but then again. you dont want to use format the date when using [year]. i expect it is not even a date format so format date would not work, i guess.

I only tried it with Year because I saw an example somewhere in the Dev area or in the standard fields (of MC12 Options) where it was used with FormatDate().  I would not have even thought to use it otherwise.
Logged

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42344
  • Shoes gone again!
Re: How to use: FormatDate() ?
« Reply #7 on: November 02, 2006, 09:46:39 am »

This will be fixed next build.

Fixed: FormatDate(...) expressions didn't properly support the 3 parameter version for display with no dates.

After that, use this expression to get what you want:
FormatDate([Date, 0], yyyy, 0000)
Logged
Matt Ashland, JRiver Media Center
Pages: [1]   Go Up