Can anybody suggest how to return records with null values when using the greater than or equal to and less than or equal to criteria in a query please?
The SQL text in the query below works fine where there is a figure in the ROSStart/ROSEnd/LFVarStart/LFVarEnd columns, however if they are blank the rows are ignored and I am unable to figure out a way around this after what feels like thousands of different cominations of queries/formulae!!!
Thanks in advance.
SELECT [Tbl-Flight Model Output (By Prod) S07].Origin, [Tbl-Flight Model Output (By Prod) S07].Dest, [Tbl-Flight Model Output (By Prod) S07].[Product Type], [Tbl-Flight Model Output (By Prod) S07].[Flight Code], [Tbl-Flight Model Output (By Prod) S07].[Dep Date], [Tbl-Flight Model Output (By Prod) S07].[Days to Dep], [Tbl-Flight Model Output (By Prod) S07].[ROS %], [Tbl-Flight Model Output (By Prod) S07].[TY Cax], [Tbl-Flight Model Output (By Prod) S07].[TY Pax], [Tbl-Flight Model Output (By Prod) S07].[TY Sts], [Tbl-Flight Model Output (By Prod) S07].[TY LF], [Tbl-Flight Model Output (By Prod) S07].[LF Var], [Tbl-Flight Model Output (By Prod) S07].[TY Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[7 Day Pax], [Tbl-Flight Model Output (By Prod) S07].[7 Day Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[LY Cax], [Tbl-Flight Model Output (By Prod) S07].[LY LF], [Tbl-Flight Model Output (By Prod) S07].[LY LF Final], [Tbl-Flight Model Output (By Prod) S07].[LY LF 1wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 2wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 3wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 4wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 5wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 6wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 7wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 8wk out], [Tbl-Flight Model Output (By Prod) S07].[LY Pax], [Tbl-Flight Model Output (By Prod) S07].[LY Final Pax], [Tbl-Flight Model Output (By Prod) S07].[Pax 1Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 2Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 3Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 4Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 5Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 6Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 7Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 8Wk], [Tbl-Flight Model Output (By Prod) S07].[LY Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[LY Final Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 1Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 2Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 3Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 4Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 5Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 6Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 7Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 8Wk]
FROM [Tbl-Flight Model Output (By Prod) S07]
WHERE ((([Tbl-Flight Model Output (By Prod) S07].Origin) Like [forms]![Flt Rpt By Prod S07]![QryOrig]) AND (([Tbl-Flight Model Output (By Prod) S07].Dest) Like [forms]![Flt Rpt By Prod S07]![QryDest]) AND (([Tbl-Flight Model Output (By Prod) S07].[Product Type]) Like [forms]![Flt Rpt By Prod S07]![QryProd]) AND (([Tbl-Flight Model Output (By Prod) S07].[Flight Code]) Like [forms]![Flt Rpt By Prod S07]![QryFltCode]) AND (([Tbl-Flight Model Output (By Prod) S07].[Dep Date])>=[forms]![Flt Rpt By Prod S07]![QryDepDateStart] And ([Tbl-Flight Model Output (By Prod) S07].[Dep Date])<=[forms]![Flt Rpt By Prod S07]![QryDepDateEnd]) AND (([Tbl-Flight Model Output (By Prod) S07].[ROS %])>=[forms]![Flt Rpt By Prod S07]![QryROSStart] And ([Tbl-Flight Model Output (By Prod) S07].[ROS %])<=[forms]![Flt Rpt By Prod S07]![QryROSEnd]) AND (([Tbl-Flight Model Output (By Prod) S07].[LF Var])>=[forms]![Flt Rpt By Prod S07]![QryLFVarStart] And ([Tbl-Flight Model Output (By Prod) S07].[LF Var])<=[forms]![Flt Rpt By Prod S07]![QryLFVarEnd]) AND (([Tbl-Flight Model Output (By Prod) S07].Team_Models) Like [forms]![selection]![dest]));
The SQL text in the query below works fine where there is a figure in the ROSStart/ROSEnd/LFVarStart/LFVarEnd columns, however if they are blank the rows are ignored and I am unable to figure out a way around this after what feels like thousands of different cominations of queries/formulae!!!
Thanks in advance.
SELECT [Tbl-Flight Model Output (By Prod) S07].Origin, [Tbl-Flight Model Output (By Prod) S07].Dest, [Tbl-Flight Model Output (By Prod) S07].[Product Type], [Tbl-Flight Model Output (By Prod) S07].[Flight Code], [Tbl-Flight Model Output (By Prod) S07].[Dep Date], [Tbl-Flight Model Output (By Prod) S07].[Days to Dep], [Tbl-Flight Model Output (By Prod) S07].[ROS %], [Tbl-Flight Model Output (By Prod) S07].[TY Cax], [Tbl-Flight Model Output (By Prod) S07].[TY Pax], [Tbl-Flight Model Output (By Prod) S07].[TY Sts], [Tbl-Flight Model Output (By Prod) S07].[TY LF], [Tbl-Flight Model Output (By Prod) S07].[LF Var], [Tbl-Flight Model Output (By Prod) S07].[TY Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[7 Day Pax], [Tbl-Flight Model Output (By Prod) S07].[7 Day Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[LY Cax], [Tbl-Flight Model Output (By Prod) S07].[LY LF], [Tbl-Flight Model Output (By Prod) S07].[LY LF Final], [Tbl-Flight Model Output (By Prod) S07].[LY LF 1wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 2wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 3wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 4wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 5wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 6wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 7wk out], [Tbl-Flight Model Output (By Prod) S07].[LY LF 8wk out], [Tbl-Flight Model Output (By Prod) S07].[LY Pax], [Tbl-Flight Model Output (By Prod) S07].[LY Final Pax], [Tbl-Flight Model Output (By Prod) S07].[Pax 1Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 2Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 3Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 4Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 5Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 6Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 7Wk], [Tbl-Flight Model Output (By Prod) S07].[Pax 8Wk], [Tbl-Flight Model Output (By Prod) S07].[LY Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[LY Final Mgn/Pax], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 1Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 2Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 3Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 4Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 5Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 6Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 7Wk], [Tbl-Flight Model Output (By Prod) S07].[Mgn/Pax 8Wk]
FROM [Tbl-Flight Model Output (By Prod) S07]
WHERE ((([Tbl-Flight Model Output (By Prod) S07].Origin) Like [forms]![Flt Rpt By Prod S07]![QryOrig]) AND (([Tbl-Flight Model Output (By Prod) S07].Dest) Like [forms]![Flt Rpt By Prod S07]![QryDest]) AND (([Tbl-Flight Model Output (By Prod) S07].[Product Type]) Like [forms]![Flt Rpt By Prod S07]![QryProd]) AND (([Tbl-Flight Model Output (By Prod) S07].[Flight Code]) Like [forms]![Flt Rpt By Prod S07]![QryFltCode]) AND (([Tbl-Flight Model Output (By Prod) S07].[Dep Date])>=[forms]![Flt Rpt By Prod S07]![QryDepDateStart] And ([Tbl-Flight Model Output (By Prod) S07].[Dep Date])<=[forms]![Flt Rpt By Prod S07]![QryDepDateEnd]) AND (([Tbl-Flight Model Output (By Prod) S07].[ROS %])>=[forms]![Flt Rpt By Prod S07]![QryROSStart] And ([Tbl-Flight Model Output (By Prod) S07].[ROS %])<=[forms]![Flt Rpt By Prod S07]![QryROSEnd]) AND (([Tbl-Flight Model Output (By Prod) S07].[LF Var])>=[forms]![Flt Rpt By Prod S07]![QryLFVarStart] And ([Tbl-Flight Model Output (By Prod) S07].[LF Var])<=[forms]![Flt Rpt By Prod S07]![QryLFVarEnd]) AND (([Tbl-Flight Model Output (By Prod) S07].Team_Models) Like [forms]![selection]![dest]));