I have a MySQL database which contains a varchar field that stores dates in the format YYYY-MM-DD.
I need to do a count of the following records
Year To Date
SELECT COUNT(*)
AS ytd
FROM termine
WHERE von=$user_id
AND datum= !!---FIRST 4 DIGITS = CURRENT YEAR!!
MONTH TO DATE
SELECT COUNT(*)
AS mtd
FROM termine
WHERE von=$user_id
AND datum= !!---CHARACTERS 6+7 = CURRENT MONTH!!
WEEK TO DATE
SELECT COUNT(*)
AS wtd
FROM termine
WHERE von=$user_id
AND datum= !!---NO IDEA!!
Any help would be greatly appreciated, I can define $current_year, $current_month vars if they are needed, but I think this can all be done with MySQL?