SQL WHERE Statement
I am trying to write a query where the date used could be one of 3 depending on if the dates are valid or not.
In the screenshot below I have managed to create a field PODate to contain the correct date that I want to see in the report depending when whether the ConfDelivDate, AvailShipDate or ReqDate is valid.
In the Crystal Report that this originated in the PODate can be used to group data by and also as part of the data selection.
In SQL I can use the PODate for Ordering the data.
However, when I use it in the WHERE statement I get an error.
Any ideas on what I should be putting in the WHERE clause?
I am trying to write a query where the date used could be one of 3 depending on if the dates are valid or not. In the screenshot below I have managed to create a field PODate to contain the correct date that I want to see in the report depending when whether the ConfDelivDate, AvailShipDate or ReqDate is valid.In the Crystal Report that this originated in the PODate can be used to group data by and also as part of the data selection.In SQL I can use the PODate for Ordering the data.However, when I use it in the WHERE statement I get an error.Any ideas on what I should be putting in the WHERE clause? Read More