SELECT Forecast.YMD, Forecast.StationName, Forecast.FPID, Forecast.FW, RealWeather.RR AS 表达式1, IIf((Terms.WclassA>0),IIf(IsNull(RealWeather.RR),0,1),IIf(IsNull(Forecast.FW),Null,0)) AS YBJS, IIf((Terms.WclassB=1),IIf(IsNull(Forecast.FW),0,1),IIf(IsNull(RealWeather.RR),1,0)) AS QY
FROM Forecast, StationMapStation, terms, RealWeather, ForecastPeriods
WHERE (((Forecast.StationName)=[StationMapStation].[StationName] And (Forecast.StationName) ALike [输入站名]) AND ((Forecast.FPID)=[ForecastPeriods].[FPID]) AND ((Forecast.FW)=[Terms].[W]) AND ((StationMapStation.MapStationNumber)=[RealWeather].[StationNum]) AND ((Format(DateAdd("h",[ForecastPeriods].[T],[Forecast].[YMD]),"Short Date"))=Format([RealWeather].[YMD],"Short Date")) AND ((DatePart("yyyy",[Forecast].[YMD]))=[输入年份]) AND ((DatePart("m",[Forecast].[YMD]))=[输入月份]));