how exactly do i count the records in a table by a date.

the date is entered as a number long

yyyymmdd


i want to use a variable for the date

any help is greatly appreciated