Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: recordNumber converting non-date collector numbers to dates #394

Closed
ljwalker opened this issue Sep 28, 2023 · 4 comments
Closed

[Bug]: recordNumber converting non-date collector numbers to dates #394

ljwalker opened this issue Sep 28, 2023 · 4 comments

Comments

@ljwalker
Copy link
Collaborator

ljwalker commented Sep 28, 2023

Contact Details

Diana Sawatzky

Symbiota portal name

SEINet (NANSH)

What happened?

Collector numbers that resemble dates (but are not dates) are automatically converted to date format in the Occurrence Editor and then displayed publicly as dates. For example, in 30466397, the collection number on the sheet is "08-27", but it appears as "27-Aug" in Symbiota. This conversion proliferates to spreadsheet exports of the same records.

recordNumber type = "varchar(45)", not "date"

Examples:

What operational systems are you seeing the problem on?

MacOS

What browsers are you seeing the problem on?

Firefox

@ljwalker ljwalker added the bug Something isn't working label Sep 28, 2023
@egbot
Copy link
Member

egbot commented Sep 28, 2023

This is an issue with Excel, which folks have been struggling with for as long as I know. Symbiota never reformats the collector number, but this type of reformatting is a common problem with Excel. The data was likely corrupted by Excel, and then imported into the portal.

When a spreadsheet (e.g. CSV) is opened in Excel, the application unfortunately evaluates each field and tries to guess the data type. It's not uncommon for a non-date fields to be translated and displayed as a date. If you don't resave the data, it's just the display of the data that is incorrect. If you open the same file within a text editor (e.g. notepad++, MS notepad, MS wordpad, etc), you will see that the format is correct. Unfortunately, if you save the file after opening it up in Excel, if will rewrite the field with the incorrectly interpreted date value. Excel will also trim zeros of the end of numbers, and sometimes round coordinates to the nearest cent. If you then upload the file, the record will contain the wrong data. For more information on this subject, see here or Google "stop excel from auto formatting dates"

Therefore, we recommend that folks don't use Excel. If you do, it's best to only use it to view the data, and avoid resaving. Alternatively, you can use other spreadsheet editors such as OpenOffice, LibreOffice, etc.

@egbot egbot closed this as completed Sep 28, 2023
@egbot egbot removed the bug Something isn't working label Sep 28, 2023
@ljwalker
Copy link
Collaborator Author

ljwalker commented Sep 28, 2023

@egbot I forgot to include a screenshot. The main issue is that this is happening in Symbiota, but good to know about Excel:
Screenshot 2023-09-28 at 12 24 41 PM

@themerekat
Copy link
Collaborator

@ljwalker , are they importing the data first from a spreadsheet or directly entering it from the label?

@egbot
Copy link
Member

egbot commented Sep 29, 2023

It can't happen in Symbiota, there is mechanism to make this data conversion, but this type of thing regularly happen in Excel. And looking at the data edits (via admin tab on editor), there appears to be no data entry edits via the user interface. Thus, it looks like they upload the data via a CSV upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants