This is a discussion on Vague dates within the MySQL Database forums, part of the Database Forums category; I'm creating a table of objects, including their year of manufacture. In some cases the year of manufacture will ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm creating a table of objects, including their year of manufacture.
In some cases the year of manufacture will be very precise, '1855', say. In other cases the year will be much more vague - 'circa 1830', '1780 - 1820' or even 'early 19th century'. Indeed, as the objects get more ancient, I can well imagine that their ages become much less precise. Just wondered if anyone had any suggestions about ways of storing this kind of information. |
|
|||
|
varchar!
== Quote from strawberry (zac.carey@gmail.com)'s article > I'm creating a table of objects, including their year of manufacture. > In some cases the year of manufacture will be very precise, '1855', > say. In other cases the year will be much more vague - 'circa 1830', > '1780 - 1820' or even 'early 19th century'. Indeed, as the objects get > more ancient, I can well imagine that their ages become much less > precise. Just wondered if anyone had any suggestions about ways of > storing this kind of information. |
|
|||
|
strawberry wrote:
> I'm creating a table of objects, including their year of manufacture. > In some cases the year of manufacture will be very precise, '1855', > say. In other cases the year will be much more vague - 'circa 1830', > '1780 - 1820' or even 'early 19th century'. Indeed, as the objects get > more ancient, I can well imagine that their ages become much less > precise. Just wondered if anyone had any suggestions about ways of > storing this kind of information. I presume you wish to search by date at some point. Perhaps store a mid-point and a range. So 1780-1820 would be mid-point = 1800, range = 20 (i.e. +/- 20 years from mid-point). Then you can query it using mid-point - range and mid-point + range. -- Brian Wakem Email: http://homepage.ntlworld.com/b.wakem/myemail.png |
|
|||
|
strawberry wrote:
> I'm creating a table of objects, including their year of manufacture. > In some cases the year of manufacture will be very precise, '1855', > say. In other cases the year will be much more vague - 'circa 1830', > '1780 - 1820' or even 'early 19th century'. Indeed, as the objects get > more ancient, I can well imagine that their ages become much less > precise. Just wondered if anyone had any suggestions about ways of > storing this kind of information. > I store the start and end years as integers. This makes comparison with another potentially overlapping period reasonably straightforward. Chad -- Chad Hanna Systems Developer FamilyHistoryOnline www.familyhistoryonline.net FreeBSD Apache MySQL Perl mod_perl PHP |
|
|||
|
On Apr 25, 2:18 am, Chad Hanna <c...@chadhanna.co.uk> wrote:
> strawberry wrote: > > I'm creating a table of objects, including their year of manufacture. > > In some cases the year of manufacture will be very precise, '1855', > > say. In other cases the year will be much more vague - 'circa 1830', > > '1780 - 1820' or even 'early 19th century'. Indeed, as the objects get > > more ancient, I can well imagine that their ages become much less > > precise. Just wondered if anyone had any suggestions about ways of > > storing this kind of information. > > I store the start and end years as integers. This makes comparison with > another potentially overlapping period reasonably straightforward. > > Chad > > -- > Chad Hanna > Systems Developer FamilyHistoryOnlinewww.familyhistoryonline.net > FreeBSD Apache MySQL Perl mod_perl PHP Brian, Chad, Thanks for the suggestions - I think the idea of a mid-point and tolerance will be the simplest for me to maintain. Cheers |
![]() |
| Thread Tools | |
| Display Modes | |
|
|