Hi there,
I've got page that allows a user to enter in a year to search a field in a database, this all sounds simple enough but this is where it gets tricky.
The field in the databse has results like these...
1822
1825-1930
1876
the user NEEDS to be able to search this field by typing into the form things like this...
19th Century - would return 1822, 1825-1930 and 1876
early 19th Century - would return 1822 and 1825-1930
mid 19th Century - would return 1825-1930
late 19th Century - would return 1876
circa 1850 - would return 1825-1930
approx 1850 - would return 1825-1930
1900-1922 - would return 1825-1930
1867 - wouldn't return any
So you see it's not as simple as entering a date into a field and searching by that.
How do you recommend I go about using the users input to search the field which is stored as a varchar datatype.
I've got page that allows a user to enter in a year to search a field in a database, this all sounds simple enough but this is where it gets tricky.
The field in the databse has results like these...
1822
1825-1930
1876
the user NEEDS to be able to search this field by typing into the form things like this...
19th Century - would return 1822, 1825-1930 and 1876
early 19th Century - would return 1822 and 1825-1930
mid 19th Century - would return 1825-1930
late 19th Century - would return 1876
circa 1850 - would return 1825-1930
approx 1850 - would return 1825-1930
1900-1922 - would return 1825-1930
1867 - wouldn't return any
So you see it's not as simple as entering a date into a field and searching by that.
How do you recommend I go about using the users input to search the field which is stored as a varchar datatype.