Author Topic: IF command  (Read 1079 times)

Fox63

  • Jr. Member
  • **
  • Posts: 109
hi,

I'm trying to make a simple comparison.

Code
$If(<Year>=<Original Year>,true-value,false-value)

But it doesn't work and it's always true or false depending on the comparison if it's the same or different.
Am I doing something wrong?

hiccup

  • Sr. Member
  • ****
  • Posts: 7908
But it doesn't work and it's always true or false depending on the comparison if it's the same or different.
That may have come out differently from what you intended, as that describes a correctly functioning formula ;-)

My guess is that where you see unexpected outcomes, there is something in one of the year tags that 'escapes the eye' so to speak.
(you could use the Tag Inspector to check their values side by side)


Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34369
both fields are date types. If either field value doesnt parse as a valid year or date then the comparison wont work

hiccup

  • Sr. Member
  • ****
  • Posts: 7908
If this concerns mp3 specifically, also check if the files possibly contain additional variations on Original Year tags.

such as:



edit:
Hmm, in fact there may something weird going on with Original Year.
Some testing I did gives strange and incorrect results indeed:


(all mp3 ID3v2.3 files)

I have no clue what's going on here.
 
Last Edit: August 06, 2023, 01:42:56 PM by hiccup

Fox63

  • Jr. Member
  • **
  • Posts: 109
both fields are date types. If either field value doesnt parse as a valid year or date then the comparison wont work

So if I understand correctly the format for the comparison must be dd/mm/yyyy?
Can't compare 1976-2000? But only 01/01/1976 - 01-01-2000!!!!

modify:
Effectively putting the format dd/mm/yyyy the comparison is performed.
But it doesn't make much sense. Most, I think, will just put the year.
Last Edit: August 07, 2023, 09:47:59 AM by Fox63

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34369
both fields are date types. If either field value doesnt parse as a valid year or date then the comparison wont work
So if I understand correctly the format for the comparison must be dd/mm/yyyy?
no you dont understand correctly. The value must be a valid year or a valid date

Fox63

  • Jr. Member
  • **
  • Posts: 109
both fields are date types. If either field value doesnt parse as a valid year or date then the comparison wont work
So if I understand correctly the format for the comparison must be dd/mm/yyyy?
no you dont understand correctly. The value must be a valid year or a valid date

I'm sorry but I don't understand what you mean valid year!!!
Written like this, is "1980" not a valid year?

Anyway I fixed it: putting the field <Year (yyyy)> instead of <Year> everything works fine.

I saw that the field <Year (yyyy)> is of type number while <Original Year> is date but this is how it works.

The Incredible Boom Boom

  • Sr. Member
  • ****
  • Posts: 1282

Anyway I fixed it: putting the field <Year (yyyy)> instead of <Year> everything works fine.

I saw that the field <Year (yyyy)> is of type number while <Original Year> is date but this is how it works.

The most likely explanation is <Year> contains the month and day in some of your tags and just the year in others.
<Year (yyyy)> produces a four digit result, while <Original Year> is also a four digit result.