# Automatic assignment of references to bibliography categories depending on origdate or date

I'm using biblatex-chicago with the author-date option. I love biblatex and biblatex-chicago and appreciate the work that has been put into it. I have a small question, however. I usually divide my bibliography into sections using

\DeclareBibliographyCategory{A}


in the preamble and then

\autocite{B}



following a citation of B.

Now I wonder, if it's possible to have a bibliography category:

\DeclareBibliographyCategory{Before1900}


and have a reference be added automatically to the category Before1900 if:

1. It has an origdate value and that value is lower than 1900;
2. It has no origdate value but the date value is lower than 1900.

I would be interested in such an option since it would enable me to automatically create a split bibliography according to the date a source was written/published.

-

biblatex allows us to filter the entries to be inserted in a bibliography.

First of all you have to define the conditions to be used using \definebibcheck

\defbibcheck{pre}{
\iffieldint{origyear}
{\ifnumless{\thefield{origyear}}{1900}
{}
{\skipentry}
}
{\iffieldint{year}
{\ifnumless{\thefield{year}}{1900}
{}
{\skipentry}
}
{\skipentry}
}
}

\defbibcheck{post}{
\iffieldint{origyear}
{\ifnumless{1899}{\thefield{origyear}}
{}
{\skipentry}
}
{\iffieldint{year}
{\ifnumless{1899}{\thefield{year}}
{}
{\skipentry}
}
{
\skipentry %comment out this line if unknown date check used as well.
}
}
}


after that you can use the checks in a \printbibliography command

\printbibliography[check=pre,title={Before 1900}]

\printbibliography[chek=post,title={Post 1900}]


EDIT

To create a third class of entries, those with unclear dating, the check could be as follows:

\defbibcheck{dateunknown}{
\ifboolexpr{
test {\iffieldundef{year}}
and
test {\iffieldundef{origyear}}
}
{}
{\skipentry}
}

-
Thank you! That works perfectly. Is there a way that I can make a third bibliography where works would appear that LACK both an origdate and a date field? (For works that are of unclear dating.) – Mårten Nov 24 '12 at 16:50
Thanks again, this is really helpful! – Mårten Nov 25 '12 at 20:13
I get an error message when I try to use the third check. I've tried to play around with it but I'm too inept at code to make it work. Does it work for you? – Mårten Dec 16 '12 at 20:32
@Mårten Indeed there were a few typos and mistakes. They should be fixed now. – Guido Dec 17 '12 at 1:06
Thanks! Now the undated references appear in a separate bibliography, but they still also appear in the check=post category. Do you know how to prevent them from being listed there as well? – Mårten Dec 17 '12 at 1:26