SyntaxTerror
Technical User
Hello What would be the best way to implement this where statement pseudocode with proper syntax? Basically, I'm trying to pull dates out of a temp table I've created using subqueries
WHERE CreatedDateTime BETWEEN (SELECT StartDate FROM #temp) AND (SELECT EndDate FROM #temp)
The CreatedDateTime, StartDate, and EndDate are all smalldatetime datatypes.
When I attempt to run this code, I get the error, "Subquery returned more than 1 value. This is not permitted when the subqury follows =, !=, <, <=, >, >= or when the subquery is used as an expression."
Thanks for the help
WHERE CreatedDateTime BETWEEN (SELECT StartDate FROM #temp) AND (SELECT EndDate FROM #temp)
The CreatedDateTime, StartDate, and EndDate are all smalldatetime datatypes.
When I attempt to run this code, I get the error, "Subquery returned more than 1 value. This is not permitted when the subqury follows =, !=, <, <=, >, >= or when the subquery is used as an expression."
Thanks for the help