If you are pulling from a database you will need to use SQL first to query the data from it. Also, I tend to format the dates as a number when used in the logic that way I don't have to worry about comparing dates with different formats.
Also, notice the MakeDate() function. It takes year, month, day parameters.
LIB CONNECT TO 'PROLAXRUN_DB (cb_77280)';
Num(Floor(MAX_AS_OF_DATE)) as MaxDate //Format as number to make easier
Max("AS_OF_DATE") as MAX_AS_OF_DATE
Let vMaxDate = Peek('MaxDate',0,'MaxDate'); //Store value in variable
Let vMaxDate_1 = $(vMaxDate)-1;
Drop Table MaxDate;
Year("AS_OF_DATE") as AS_OF_YEAR,
Month("AS_OF_DATE") as AS_OF_MONTH,
Day("AS_OF_DATE") as AS_OF_DAY,
WildMatch(Num(Floor("AS_OF_DATE")),Num(MakeDate(2018,12,31)), Num(MakeDate(2019,03,31)),Num(MakeDate(2019,06,30)), '$(vMaxDate)','$(vMaxDate_1)') > 0